header
 
Untitled Document
Course: CSC204
   
- Basic OS Theory
- OS – User View
- OS – System View
- DOS
- Linux
- Windows
1
 
Free Online Tutorial ::
To be a center of structured knowledge for all. All instructors are welcome to participate in this knowledge distribution.
 
 
Courses:CSC204
CSC204, DOS Basic Command
 
Lab Session 1
Please download this lab assignment and fill in the the answers.

Download here

MS-DOS commands


In the personal computer operating systems MS-DOS and PC DOS, a number of standard system commands were provided for common tasks such as listing files on a disk or moving files. Some commands were built-in to the command interpreter, others existed as transient commands loaded into memory when required. Over the several generations of MS-DOS, commands were added for the additional functions of the operating system. In the current Microsoft Windows operating system a text-mode command prompt window can still be used. Some DOS commands carry out functions equivalent to those in a UNIX system but always with differences in details of the function.

Resident and transient commands

The command interpreter for MS-DOS runs when no application programs are running. When an application exits, if the command interpreter in memory was overwritten, MS-DOS will re-load it from disk. The command interpreter is usually stored in a file called "COMMAND.COM". Some commands are internal and built-into COMMAND.COM, others are stored on disk in the same way as application programs. When the user types a line of text at the operating system command prompt, COMMAND.COM will parse the line, and attempt to match a command name to a built-in command or to the name of an executable program file or batch file on disk. If no match is found, an error message is printed and the command prompt is refreshed.[1]

Resident commands varied slightly between revisions of MS-DOS. Typically, the functions DIR (list directory), ERASE or DEL (erase a file or directory), COPY (copy files), DATE (display or set date), TIME (display or set time), CD (change working directory), MD (make a directory on the current disk), REN (rename a file or directory) and some others were resident in COMMAND.COM.

Transient commands were too large to keep in the command processor, or were less frequently used. Such utility programs would be stored on disk and loaded just like regular application programs, but were distributed with the operating system. Copies of these utility command programs had to be on an accessible disk, either on the current logged-in floppy drive or on the command path set in the command interpreter.

A special type of external, transient command is the batch file, containing a set of commands that are processed as if entered at the command line. Some additional keywords are recognized by the command interpreter COMMAND.COM to make batch files more useful. These commands aren't useful if typed in interactively at the command prompt, but allow flexible processing by a batch file.


 
CSC204, DOS Basic Command
 
Command-Line Programs for Intranets and the Internet
http://mirror.href.com/thestarman/DOS/DOS7NET.htm


The Windows™ 95/98 Network Programs
Mostly
Command-Line Programs for Intranets and the Internet


Note: Microsoft ported most of these programs directly from Windows NT 4.0 or even NT 3.5

Sometimes people think of these programs as MS-DOS commands, but they have nothing to do with the Disk Operating System! They are simply Command-Line (or Window's Console) programs which were included with the Windows 95/98 OSs. They are all full 32-bit programs which means they cannot be exectued until after Windows (a 32-bit operating system) is up and running. These programs are found in your WINDOWS directory.


Click here for a whole page of real examples using the
Interactive or Batch-run :

Command-Line ftp Client: FTP.exe.


The Network programs discussed on this page are:

NETSTAT.exe (TCP/IP Net Connections)

PING.exe       TRACERT.exe (Trace Route)

NBSTAT.exe       ROUTE.exe       ARP.exe


NETSTAT.exe      TCP/IP Network Statistics

Displays protocol statistics and current TCP/IP network connections.

NETSTAT [-a] [-e] [-n] [-s] [-p proto] [-r] [interval]

-a Displays all connections and listening ports.

-e Displays Ethernet statistics. This may be combined with the
-s option.

-n Displays addresses and port numbers in numerical form.

-p proto Shows connections for the protocol specified by proto; proto
may be TCP or UDP. If used with the -s option to display
per-protocol statistics, proto may be TCP, UDP, or IP.

-r Displays the routing table.

-s Displays per-protocol statistics. By default, statistics
are shown for TCP, UDP and IP; the -p option may be used
to specify a subset of the default.

interval Redisplays selected statistics, pausing interval seconds
between each display. Press CTRL+C to stop redisplaying
statistics. If omitted, netstat will print the current
configuration information once.

First, I would recommend that you always use the '-a' parameter so you can see UDP 'listening ports' as well (often used by trojans), and not just the active TCP connections; then switch between using the '-a' and no parameters at all, to see the differences. When you're offline, you normally shouldn't see any connection data! If you do see an OPEN PORT NUMBER 'listening' for a connection (using the '-a' parameter), it may be that your computer has been infected with a trojan!   Click this link for a few more ideas on how you can check to see if your computer is Trojan Free?

If you're running a server, such as the free XITAMI server, you might see something like this ("My_Comp" is the name of my computer):
C:\WINDOWS>netstat -a

Active Connections

Proto Local Address Foreign Address State
TCP My_Comp:ftp localhost:0 LISTENING
TCP My_Comp:80 localhost:0 LISTENING
Or with the "-an" parameters:
C:\WINDOWS>netstat -an

Active Connections

Proto Local Address Foreign Address State
TCP 0.0.0.0:21 0.0.0.0:0 LISTENING
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING
By simply opening a browser connection to both the HTTP (port 80) and FTP (port 21) servers (while still offline!), I saw the following:
C:\WINDOWS>netstat -a

Active Connections

Proto Local Address Foreign Address State
TCP My_Comp:ftp localhost:0 LISTENING
TCP My_Comp:80 localhost:0 LISTENING
TCP My_Comp:1104 localhost:0 LISTENING
TCP My_Comp:ftp localhost:1104 ESTABLISHED
TCP My_Comp:1102 localhost:0 LISTENING
TCP My_Comp:1103 localhost:0 LISTENING
TCP My_Comp:80 localhost:1111 TIME_WAIT
TCP My_Comp:1104 localhost:ftp ESTABLISHED
TCP My_Comp:1107 localhost:0 LISTENING
TCP My_Comp:1112 localhost:80 TIME_WAIT
UDP My_Comp:1102 *:*
UDP My_Comp:1103 *:*
UDP My_Comp:1107 *:*
This may be a bit confusing to some people, but remember I'm running BOTH the servers and clients on the same machine in these examples. A little later (using both 'a' and 'n') I got this:
C:\WINDOWS>netstat -an

Active Connections

Proto Local Address Foreign Address State
TCP 0.0.0.0:21 0.0.0.0:0 LISTENING
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING
TCP 0.0.0.0:1104 0.0.0.0:0 LISTENING
TCP 127.0.0.1:21 127.0.0.1:1104 FIN_WAIT_2
TCP 127.0.0.1:1102 0.0.0.0:0 LISTENING
TCP 127.0.0.1:1103 0.0.0.0:0 LISTENING
TCP 127.0.0.1:1104 127.0.0.1:21 CLOSE_WAIT
TCP 127.0.0.1:1107 0.0.0.0:0 LISTENING
UDP 127.0.0.1:1102 *:*
UDP 127.0.0.1:1103 *:*
UDP 127.0.0.1:1107 *:*
After turning off my server, I ended up with this for a while:
C:\WINDOWS>netstat -an

Active Connections

Proto Local Address Foreign Address State
TCP 127.0.0.1:80 127.0.0.1:1150 TIME_WAIT
TCP 127.0.0.1:80 127.0.0.1:1151 TIME_WAIT

PING.exe

Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]
[-r count] [-s count] [[-j host-list] | [-k host-list]]
[-w timeout] destination-list

Options:
-t Ping the specifed host until interrupted.
-a Resolve addresses to hostnames.
-n count Number of echo requests to send.
-l size Send buffer size.
-f Set "Don't Fragment" flag in packet.
-i TTL Time To Live.
-v TOS Type Of Service.
-r count Record route for count hops.
-s count Timestamp for count hops.
-j host-list Loose source route along host-list.
-k host-list Strict source route along host-list.
-w timeout Timeout in milliseconds to wait for each reply.

There's one special IP number everyone should know about:

127.0.0.1 - localhost (or loopback).
This is used to connect ( through a browser, for example) to a Web server on your own computer. (127 being reserved for this purpose.) You can use this IP number at all times. It doesn't matter if you're connected to the Internet or not.

It's also called the loopback address because you can ping it and get returns even when you're offline (not connected to any network). If you don't get any valid replies, then there's a problem with the computer's Network settings. Here's a typical response to the 'ping' command:


Here's another recent example using the name of my computer which I have tied to the IP number 127.0.0.1 in my C:\WINDOWS\HOSTS file:
C:\WINDOWS>ping My_Comp

Pinging My_Comp [127.0.0.1] with 32 bytes of data:

Reply from 127.0.0.1: bytes=32 time=1ms TTL=128
Reply from 127.0.0.1: bytes=32 time=1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<10ms TTL=128
Reply from 127.0.0.1: bytes=32 time=1ms TTL=128

Ping statistics for 127.0.0.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms

TRACERT.exe           Trace Route

Usage:
tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name

Options:
-d Do not resolve addresses to hostnames.
-h maximum_hops Maximum number of hops to search for target.
-j host-list Loose source route along host-list.
-w timeout Wait timeout milliseconds for each reply.


Here's an example which traces the route from some ISP in Los Angeles to the main server at UCLA in California ( note how two computers relatively close to each other may be routed way round about! ):
C:\WINDOWS>tracert www.ucla.edu

Tracing route to www.ucla.edu [169.232.33.129]
over a maximum of 30 hops:

1 141 ms 132 ms 140 ms wla-ca-pm6.icg.net [165.236.29.85]
2 134 ms 131 ms 139 ms whv-ca-gw1.icg.net [165.236.29.65]
3 157 ms 132 ms 143 ms f3-1-0.lai-ca-gw1.icg.net [165.236.24.89]
4 194 ms 193 ms 188 ms a0-0-0-1.dai-tx-gw1.icg.net [163.179.235.61]
5 300 ms 211 ms 214 ms a1-1-0-1.ati-ga-gw1.icg.net [163.179.235.186]
6 236 ms 237 ms 247 ms a5-0-0-1.was-dc-gw1.icg.net [163.179.235.129]
7 258 ms 236 ms 244 ms 163.179.243.205
8 231 ms 233 ms 230 ms wdc-brdr-03.inet.qwest.net [205.171.4.153]
9 240 ms 230 ms 236 ms wdc-core-03.inet.qwest.net [205.171.24.69]
10 262 ms 264 ms 263 ms hou-core-01.inet.qwest.net [205.171.5.187]
11 281 ms 263 ms 259 ms hou-core-03.inet.qwest.net [205.171.23.9]
12 272 ms 229 ms 222 ms lax-core-02.inet.qwest.net [205.171.5.163]
13 230 ms 217 ms 230 ms lax-edge-07.inet.qwest.net [205.171.19.58]
14 228 ms 219 ms 220 ms 63-145-160-42.cust.qwest.net [63.145.160.42]
15 218 ms 222 ms 218 ms ISI-7507--ISI.POS.calren2.net [198.32.248.21]
16 232 ms 222 ms 214 ms UCLA--ISI.POS.calren2.net [198.32.248.30]
17 234 ms 226 ms 226 ms cbn5-gsr.calren2.ucla.edu [169.232.1.18]
18 245 ms 227 ms 235 ms www.ucla.edu [169.232.33.129]

Trace complete.



    Note: Unless you're running a network, the following commands won't be of much use to you...

    Furthermore, if you're concerned about Security, my advice is to NEVER use NetBios on a computer that connects to the Internet.

NBTSTAT.exe         Net Bios Stats

Displays protocol statistics and current TCP/IP connections using NBT
(NetBIOS over TCP/IP).

NBTSTAT [-a RemoteName] [-A IP address] [-c] [-n] [-r] [-R] [-s] [S]
[interval]

-a (adapter status) Lists the remote machine's name table given its
name.
-A (Adapter status) Lists the remote machine's name table given its
IP address.

-c (cache) Lists the remote name cache including the IP
addresses.

-n (names) Lists local NetBIOS names.

-r (resolved) Lists names resolved by broadcast and via WINS

-R (Reload) Purges and reloads the remote cache name table

-S (Sessions) Lists sessions table with the destination IP
addresses.

-s (sessions) Lists sessions table converting destination IP
addresses to host names via the hosts file.

RemoteName Remote host machine name.
IP address Dotted decimal representation of the IP address.

interval Redisplays selected statistics, pausing interval seconds
between each display. Press Ctrl+C to stop redisplaying
statistics.


ROUTE.exe

Manipulates network routing tables.

ROUTE [-f] [command [destination] [MASK netmask] [gateway]]



-f Clears the routing tables of all gateway entries. If this is
used in conjunction with one of the commands, the tables are
cleared prior to running the command.

command Specifies one of four commands

PRINT Prints a route
ADD Adds a route
DELETE Deletes a route
CHANGE Modifies an existing route

destination Specifies the host to send command.

MASK If the MASK keyword is present, the next parameter is
interpreted as the netmask parameter.

netmask If provided, specifies a sub-net mask value to be associated
with this route entry. If not specified, if defaults to
255.255.255.255.

gateway Specifies gateway.

All symbolic names used for destination or gateway are looked up in the
network and host name database files NETWORKS and HOSTS, respectively.
If the command is print or delete, wildcards may be used for the
destination and gateway, or the gateway argument may be omitted.


ARP.exe      Address Resolution Protocol

ARP -s inet_addr eth_addr [if_addr]
ARP -d inet_addr [if_addr]
ARP -a [inet_addr] [-N if_addr]

-a Displays current ARP entries by interrogating the current
protocol data. If inet_addr is specified, the IP and Physical
addresses for only the specified computer are displayed. If
more than one network interface uses ARP, entries for each ARP
table are displayed.
-g (Same as -a)

inet_addr Specifies an internet address.

-N if_addr Displays the ARP entries for the network interface
specified by if_addr.

-d Deletes the host specified by inet_addr.

-s Adds the host and associates the Internet address inet_addr
with the Physical address eth_addr. The Physical address is
given as 6 hexadecimal bytes separated by hyphens. The entry
is permanent.

eth_addr Specifies a physical address.

if_addr If present, this specifies the Internet address of the
interface whose address translation table should be
modified. If not present, the first applicable interface
will be used.



 
CSC204, DOS Basic Command
 
Microsoft DOS and command prompt
http://www.computerhope.com/msdos.htm#02


Quick links

All MS-DOS commands
Secret MS-DOS commands
MS-DOS applications
MS-DOS error codes
Extended error codes
PC extensions
Creating Boot Disk
Batch Files
Known MS-DOS issues
MS-DOS History
MS-DOS Top 10 commands
Questions and answers
Operating system definitions

About MS-DOS

Short for Microsoft Disk operating system, MS-DOS is a non-graphical command line operating system created for IBM compatible computers that was first introduced by Microsoft in August 1981 and was last updated in 1994 when MS-DOS 6.22 was released. Although the MS-DOS operating system is not commonly used today, the command shell used through Microsoft Windows is. Continue reading >>

MS-DOS command list
 
  * See the complete overview page for a brief description on each of the below commands.
Aansi.sys | append | arp | assign | assoc | at | atmadm | attrib
B backup | batch | bootcfg | break
Ccacls | call | cd | chcp | chdir | chdsk | chkntfs | choice | cipher | cls | cmd | color | command | comp | compact | control | convert | copy | ctty
Ddate | debug | defrag | del | delete | deltree | dir| disable | diskcomp | diskcopy | diskpart | doskey | dosshell | driveparm
Eecho | edit | edlin | emm386 | enable | endlocal | erase | exit | expand | extract
Ffasthelp | fc | fdisk | find | findstr | fixboot | fixmbr | for| format | ftp | ftype
Ggoto | gpupdate | graftabl
Hhelp | hostname
Iif | ifhlp.sys | ipconfig
JNONE
Kkeyb
Llabel | lh | listsvc | loadfix | loadhigh | lock | logoff | logon
Mmap | md | mem| mkdir | mode | more | move | msav | msbackup | msd | mscdex | mwbackup
Nnbtstat | net | netsh | netstat | nlsfunc | nslookup
ONONE
Ppath | pathping | pause | ping | popd | power | print | prompt | pushd
Qqbasic
Rrd | reg | ren | rename | rmdir | route | runas
Sscandisk | scanreg | set | setlocal | setver | sfc | share | shift | shutdown | smartdrv | sort | start | subst | switches | sys | systeminfo | systemroot
Ttaskkill | telnet | time | title | tracert | tree | type
Uundelete | unformat | unlock
Vver | verify | vol
WNONE
Xxcopy
YNONE
ZNONE

Recent MS-DOS forum posts

Headlines by FeedBurner

MS-DOS forum


 
CSC204, DOS Basic Command
 
Information on batch files
http://www.computerhope.com/batch.htm


Quick links

Batch file ABCs
Creating a batch file
Batch commands
Batch file examples
Technical support
Debug Routines

Batch file ABCs

Batch files allow MS-DOS and Microsoft Windows users to create a lists of commands to run in sequence once the batch file has been executed. For example, a batch file could be used to run frequently run commands, deleting a series of files, moving files, etc. A simple batch file does not require any special programming skills and can be done by users who have a basic understanding of MS-DOS commands.

A good example of a batch file for someone who is more familiar with Windows or the MacOS is to think of a batch file as a shortcut in Windows or an icon on the MacOS. Much like a shortcut, batch files could be used to run one or more commands or programs through the command line.

Another example of a very well known batch file is the autoexec.bat, which is a simple boot file loaded each time the computer is loaded on MS-DOS and early Windows computers. This batch file contained all the necessary commands and programs used to run MS-DOS and Windows each time the computer booted.

Creating a batch file

MS-DOS users
Microsoft Windows and other users

MS-DOS users

To create a basic batch file in MS-DOS, follow the below steps that give you an example of how to create a basic batch file.

  1. Open an MS-DOS command window or get to MS-DOS. Additional information about doing this can be found on document CHDOS.
  2. At the MS-DOS prompt, type: edit test.bat and press enter.
  3. If typed properly, you should now be in a blue screen. Within the screen, type:

    pause
    dir c:\windows
    dir c:\windows\system

  4. Once the above three lines have been typed in, click File and choose exit; when prompted to save, click "Yes." Users who do not have a mouse cursor can accomplish this same task by pressing ALT+F to access the file menu, then pressing "X" to exit, and pressing enter to save changes.
  5. Once you are back at the MS-DOS prompt, type: test and press enter. This will execute the test.bat file and begin running the file. Because the first line is pause, you will first be prompted to press a key. Once you press a key the batch file will run line-by-line; in this case, listing the files in the windows and windows\system directories.

If you wish to add more lines to this batch file you would type "edit test.bat" to edit the file again.

Additional information about the MS-DOS edit command can be found on our edit command page. Some versions of MS-DOS and bootable diskettes may not have the edit command; if this is the case, you would either need to obtain the edit.com file to access this file or use the copy con command.

Microsoft Windows and other users

A Windows user can still use the above MS-DOS steps if they wish to create a batch file. If, however, you're more comfortable using Microsoft Windows or your operating system, you can use any text editor, such as Notepad or Wordpad, to create your batch files, as long as the file extension ends with .bat. In the below example we use the Windows notepad to create a batch file.

  1. Click Start
  2. Click Run
  3. Type: notepad and press enter.
  4. Once notepad is open, type the below lines in the file or copy and paste the below lines into notepad.

    @echo off
    echo Hello this is a test batch file
    pause
    dir c:\windows

  5. Click File and click Save; browse to where you want to save the file. For the file name, type "test.bat", and if your version of Windows has a "Save as type" option, choose "All files", otherwise it will save as a text file. Once all of this has been done click the Save button and exit notepad.
  6. Now, to run the batch file, double-click or run the file like any other program. Once the batch file has completed running it will close the window automatically.

Batch commands

Just like all MS-DOS commands, all batch file commands are not case sensitive. However, in the below listing we have listed all commands in all caps to help you identify what is a command and what is not.

@Does not echo back the text after the at symbol. This is most commonly used as @ECHO OFF to prevent any of the commands in the batch file from being displayed, just the information needed.
%1The percent followed by a numeric value, beginning with one, allows users to add variables within a batch file. The below line is an example of what can be used in a batch file.

ECHO Hello %1

When the above one-line batch file is created, add your name after the batch file. For example, typing myname (being the name of the bat file) and then your name:

myname bob

would output:

Hello bob

Note: This can be extended to %2, %3, and so on.

::One of two ways of adding remarks into the batch file without displaying or executing that line when the batch file is run.
:LABELBy adding a colon in front of a word, such as LABEL, you create a category, more commonly known as a label. This allows you to skip to certain sections of a batch file such as the end of the batch file. Also see GOTO.
CALLThis is used to run another batch file within a batch file. When the batch file that is called is completed, the remainder of the original batch file is completed. Note if the batch file does not exist it will give an error message.
CHOICESee running different programs for an example of how to use this command.
  • Additional information and the syntax of this command in each version of Windows and MS-DOS can be found on our CHOICE command page.
CLSJust like the DOS command would clear your screen.
  • Additional information and the syntax of this command in each version of Windows and MS-DOS can be found on our CLS command page.
ECHOWill echo a message in the batch file. Such as ECHO Hello World will print Hello World on the screen when executed. However, without @ECHO OFF at the beginning of the batch file you'll also get "ECHO Hello World" and "Hello World." Finally, if you'd just like to create a blank line, type ECHO. adding the period at the end creates an empty line.
EXITExits out of the DOS window if the batch file is running from Windows.
  • Additional information and the syntax of this command in each version of Windows and MS-DOS can be found on our EXIT command page.
GOTO LABELUsed to go to a certain label, such as LABEL. An example of GOTO would be to GOTO END. For an example of this see running different programs.
  • Additional information and the syntax of this command in each version of Windows and MS-DOS can be found on our GOTO command page.
IFUsed to check for a certain condition if the condition exists. If that condition exists it will perform that function. To see an example of this see running different programs.
  • Additional information and the syntax of this command in each version of Windows and MS-DOS can be found on our IF command page.
PAUSEPrompt the user to press any key to continue.
REMOne of two ways of adding remarks into the batch file without displaying or executing that line when the batch file is run.
SHIFTChanges the position of replaceable parameters in a batch program.
STARTUsed for Windows 95, Windows 98, and Windows NT 4.0 and above to start a windows application; such as START C:\WINDOW\CALC would run the Windows Calculator. Users running Windows 3.x need to utilize the WIN command.  For example, WIN C:\Windows\CALC.EXE would run Windows and then Calculator after Windows has finished loading. 

Batch file examples

Running different programs
How to start Windows files and programs from a batch file
Creating a batch file delay
How to make a time log

Running different programs

Below is a simple example of how you can implement the choice options into your batch files. Each line that is in red can be left out of the batch file. They have been included to help explain some of what the batch file means. Windows 2000 and Windows XP users will need to substitute the choice command with the set command; see the set command page for additional help and information with this command.

@ECHO OFF
REM - LABEL INDICATING THE BEGINNING OF THE DOCUMENT.
:BEGIN
CLS
REM - THE BELOW LINE GIVES THE USER 3 CHOICES (DEFINED AFTER /C:)
CHOICE /N /C:123 PICK A NUMBER (1, 2, or 3)%1
REM - THE NEXT THREE LINES ARE DIRECTING USER DEPENDING UPON INPUT
IF ERRORLEVEL ==3 GOTO THREE
IF ERRORLEVEL ==2 GOTO TWO
IF ERRORLEVEL ==1 GOTO ONE
GOTO END
:THREE
ECHO YOU HAVE PRESSED THREE
GOTO END
:TWO
ECHO YOU HAVE PRESSED TWO
GOTO END
:ONE
ECHO YOU HAVE PRESSED ONE
:END

How to start Windows files and other programs from a batch file

To run Microsoft Windows programs or files use the START command. The below example would run Windows Notepad.

START /MAX NOTEPAD

You can also specify the direct location of the file by typing the below command.

START /MAX C:\Windows\NOTEPAD.EXE

*Windows users who have a different directory (e.g. Windows 2000 users) would need to substitute WINNT or the name of their directory in place of Windows in the above example.

The /m representing it to start the window Maximized. See the start command page for additional information about this command.

Creating a batch file delay

Below is an example of how to delay a batch file any where from 5 to 99 seconds. In the below example we illustrate a 5 second delay.

TYPE NUL | CHOICE.COM /N /CY /TY,5 >NUL

Additionally, you could use the sleep file found on our utility download section.

How to make a time log in a batch file

The below example demonstrates how to create a time log of when the batch file is loaded, or for example, this could be used in the autoexec.bat when someone logs into a computer that supports this file.

ECHO. |TIME > TIME
COPY LOG +TIME

An alternate, slightly more complicated method that, to our knowledge, cannot be used in Windows NT, Windows 2000 or Windows ME would be the following:

echo @prompt set date=$d$_set time=$t$h$h$h > {a}.bat
%comspec% /e:2048 /c {a}.bat > {b}.bat
for %%v in ({b}.bat del) do call %%v {?}.bat
echo %date% %time% >> log

Another alternative is:

echo. |time |find "current" >> log

For the above batch file to work properly you must create a file called log, by typing edit log and then save and exit the file, creating a 0 bytes file. If this file is not created or not created properly you will receive the error message Content of destination lost before copy.

Technical support


 
CSC204, DOS Basic Command
 
MS-DOS top 10 commands
http://www.computerhope.com/dostop10.htm

Quick links

DOS top 10 commands
DOS top 10 command pages
See all of Computer Hope's Top 10's
MS-DOS help page

DOS TOP 10 COMMANDS

Below is a listing of the top 10 MS-DOS commands most commonly used and that you will most likely use during a normal DOS session.

1.cd
2.dir
3.copy
4.del
5.edit
6.move
7.ren (rename)
8.deltree
9.cls
10.format

 

TOP 10 COMMAND PAGES

Below is a listing of the top 10 MS-DOS command pages by the amount of times they have been accessed on the Computer Hope server.

1.fdisk
2.format
3.copy
4.xcopy
5.dir
6.cd
7.deltree
8.net
9.Ansi
10.ping

 


 
CSC204, DOS Basic Command
 
How to create a boot disk
http://www.computerhope.com/boot.htm


Quick links

What is a boot disk?
Creating a MS-DOS boot disk
Creating a Windows 3.x boot disk
Creating a Windows 95 boot disk
Creating a Windows 98 or ME boot disk
Creating a Windows NT boot disk
Creating a Windows 2000 boot disk
Creating a Windows XP boot disk
Copying additional files
How to use a boot disk
Troubleshooting

What is a boot disk?

A boot disk will allow you to boot off of a diskette instead of your hard drive. This diskette can be used to fix issues that may arise during the lifetime of your computer or to help load older MS-DOS games. Keep in mind this diskette is completely different than a Restore CD or Disc that may have been included with your computer.

Tip After you have created a boot diskette, it is highly recommended that you write-protect the diskette to prevent possible computer virus infection and to help the diskette from being erased.

Creating a MS-DOS boot disk

Note: These steps are for users who have MS-DOS installed on the computer. If you have any version of Windows follow the below steps for your version of Windows.

To create a MS-DOS diskette, begin by getting to the DOS directory by typing:

cd\dos

Once at the C:\DOS directory, skip to copying files.

Creating a Windows 3.X boot disk

Note: These steps are for users who have Windows 3.x installed on the computer.

To create a Windows 3.x diskette, from Windows Program manager, click File and then choose the option to Exit Windows, which will get you to a prompt; at the prompt, type:

cd\dos

Once at the C:\DOS directory, skip to copying files.

Creating a Windows 95 boot disk

Note: These steps are for users who have Windows 95 installed on the computer.

In Windows 95, Microsoft has created a new method of creating a bootable recovery diskette. Unfortunately, however, this diskette does not support CD-ROM support and is missing a few recommended files. To do this, click Start / Settings / Control Panel / double-click the Add Remove programs icon / click the Startup Disk and create disk.

Alternatively, to create a Windows 95 boot diskette manually from Windows, click Start / Shutdown and choose the option to restart the computer in a MS-DOS prompt. At the prompt, type:

cd\windows\command

Once at the C:\DOS directory, skip to copying files.

Creating a Windows 98 / ME boot disk

Note: These steps are for users who have Windows 98 or Windows ME installed on the computer.

An excellent feature of Windows 98/ME is its boot diskette. Using Windows to create you a Windows 98 boot diskette will give you all the needed files as well as CD-ROM support. To create a Windows 98 boot diskette, click Start / Settings / Control Panel / double-click the Add Remove programs icon / click the Startup Disk and create disk.

Alternatively, to create a Windows 98 boot diskette manually from Windows, click Start / Shutdown and choose the option to restart the computer in a MS-DOS prompt. At the prompt, type:

cd\windows\command

Once at the C:\DOS directory, skip to copying files.

Copying additional files

NOTE: When making a boot disk, if you are running "Stacker" or some kind of a DoubleSpace or drive swapper program, this could not work

Once you are in DOS and at the correct directory as instructed in the above sections by operating system, you are ready to create your bootable diskette. Insert a diskette that does not contain any information (it will be erased).

At the prompt, if you have MS-DOS 6.2 / Windows 3.x / Windows 95 / Windows 98, type:

FORMAT A:/S

If you have MS-DOS 5.0 type using double density 5.25" diskettes type:

FORMAT A: /360 /S

If you have MS- DOS 3.11 through 4.0 using double density 5.25" diskettes, type:

FORMAT A: /4 /S

Once the diskette has been formatted and the system has been transferred, you should be returned to your original directory. In this directory, type:

copy format*.* a: [PRESS ENTER]
copy fdisk*.* a: [PRESS ENTER]
copy mscdex*.* a: [PRESS ENTER]
copy sys*.* a: [PRESS ENTER]
copy edit*.* a: [PRESS ENTER]

copy qbasic*.* a: [PRESS ENTER] (Win 95/98 users skip this line)
copy debug*.* a: [PRESS ENTER]
copy himem*.* a: [PRESS ENTER]
copy emm386*.* a: [PRESS ENTER]

If you are planning to use this diskette as a diskette to load games or you feel that you need mouse support, you will need to copy the mouse driver onto the boot diskette. The MS-DOS mouse driver is generally mouse.com / mouse.sys. Locate this file and copy it to your bootable diskette.

For CD-ROM support, visit our CD-ROM drivers page for information on loading your CD-ROM driver.

Once you have copied the above files, create an autoexec.bat and a config.sys. Get to the floppy drive by typing A:, once at the floppy drive, type:

copy con autoexec.bat [PRESS ENTER]
@echo off [PRESS ENTER]
LH A:\MSCDEX.EXE /D:CDROM [PRESS ENTER]
(this line is used for your CD-ROM drive).
LH A:\MOUSE.* [PRESS ENTER]
(skip line if you did not copy mouse file, the * is either sys / com).

Press and hold CTRL + Z - this should return ^Z. Once this is displayed, press enter to copy the file.

copy con config.sys [PRESS ENTER]
device=a:\himem.sys
dos=high,umb
device=a:\emm386.exe noems
files=30
buffers=20
devicehigh=a:\oakcdrom.sys /d:CDROM
(this line is used for your CD-ROM drive).

Press and hold CTRL + Z - this should return ^Z. Once this is displayed, press enter to copy the file.

Congratulations, after completing the above steps you should now have a bootable floppy diskette.

Creating a Windows NT boot disk

To create a boot diskette you must have access to the i386 directory located on your Windows NT CD or possibly your Hard disk drive.

Format the floppy diskette you wish to make a bootable Windows NT boot disk using the Windows NT machine.

Copy boot.ini, ntdetect.com and ntldr to the floppy diskette just formatted.

If you are using any SCSI devices that you need access to, you will also need to load these drivers onto the diskette.

Creating a Windows 2000 boot disk

To create a Windows 2000 Professional bootable diskette you will need four 1.44MB diskettes and the Windows 2000 Professional CD.

Click Start / Run / browse to the CD-ROM drive.
Open the "BOOTDISK" folder and double-click makeboot.exe and click ok to launch the program to create the diskette.

Users can also easily create an Emergency Repair Disk by clicking Start, Programs, Accessories, System Tools, and opening Backup. From the Backup window, click the button for Emergency Repair Disk and follow each of the steps. 

Creating a Windows XP boot disk

Note: The Microsoft Windows XP CD is a bootable CD and in many cases you should not need a bootable floppy diskette. Booting from the Windows XP CD will allow you to not only install/re-install Windows XP but will also allow you to troubleshoot it.

Create MS-DOS bootable diskette

When formatting a floppy diskette, users have the option of creating a MS-DOS startup disk, follow the below steps to do this.

  1. Place diskette in the computer.

  2. Open My Computer, right-click the A: drive and click Format.

  3. In the Format window, check Create an MS-DOS startup disk.

  4. Click Start

Create Windows XP Setup diskettes

Microsoft is beginning to phase out bootable floppy diskettes in favor of bootable CD discs and has not included a method of easily creating a bootable floppy diskette in Windows XP or from the CD. However, Microsoft has downloads available for users who still need to create bootable diskettes to install (not upgrade) Windows XP. These downloads can be found through KB310994.

How to use a boot diskette

Once the bootable diskette has been successfully created, following the below steps you will be able to boot from the diskette.

  1. Place the diskette into write-protect mode (in case a virus is on the computer, this will not allow the virus to transfer itself onto the diskette).
  2. Insert the diskette into the computer and reset or turn on the computer to begin the boot process.
  3. As the computer is booting, answer the questions prompted (if any).
  4. Once at the A:\> take the appropriate actions depending upon the situation of the computer.
  5. If you are unfamiliar with MS-DOS or the command line we recommend the MS-DOS page.

Troubleshooting


 
CSC204, DOS Basic Command
 
The Internet Glossary of DOS Terminology
http://www.animatedsoftware.com/faqs/learndos.htm#intro


Introduction:

There are not many commands you need to learn in DOS to use it effectively, but you do need to learn how to get "syntax" help. Originally there was (and currently is) a HELP facility which is itself a command: help. Some versions of Windows do not automatically install the Help command, however (Windows 95, for example).

Each command has a mini-help facility within it, which is activated by adding just the parameter /? (forward slash, question mark) to the command. But truly, typing help commandname is better because it has a far smaller possibility of error -- do you really want to type del /? or does help del feel safer? A mistype, for example missing the forward slash (del ?) will delete every file in the current directory that has a name one character long (with no extension). Mistyping the forward slash as a back slash (del \?) will delete everything in the root directory which is one character long. Granted, not too many files are like that, but they certainly can be. "A" is a legal filename. And Windows doesn't save files to the recycle bin that are deleted while in DOS mode! And formerly popular DOS programs that might have helped you undelete DOS files are now usually not recommended for Windows 95 machines (after that, I haven't checked...). As far as I know, if you delete a file in DOS these days -- it's gone. So by all means delete when necessary, but always delete with care.


DOS Command Descriptions

The first command you need to learn to use DOS is simply how to get help. Unbelievably, with Windows 95, Microsoft stopped automatically loading the MS-DOS HELP facility when you install Windows. This is the most important DOS command of all and yet Microsoft choose not to load it automatically when Windows is installed.

Fortunately, HELP is back, and in the meantime, Microsoft also completely instituted the command-by-command help standards, so you can simply type the command name and the add the two symbols /? (forward slash, question mark) after the command. Some commands take more than one page to see; use the pipeline command MORE (|more) to view the screens one at a time.

(Note: If you are (for some reason) running Windows 95, you can load the DOS HELP from the Windows CD-ROM. It is in the \OTHER\OLDMSDOS directory. You need to load QBASIC.EXE, QBASIC.HLP, HELP.HLP, and HELP.COM. They can be placed in the \WINDOWS\SYSTEM directory. Placing them there makes them immediately available again to DOS users.


help
help

This command gives you a key to virtually everything you need to use DOS effectively. Can't remember the format for the FORMAT command? Not a problem! Type HELP FORMAT and press the ENTER key, and you've got everything you need to use FORMAT! This is true for virtually every DOS command so if you remember HELP commandname you won't have any problems.

Another way to get help (or, if you don't install the HELP files suggest above, the ONLY way to get help in Windows 95) is to use /? (slash, question mark) after any command. This is faster and sometimes a more useful form of help, but it is generally only a listing of options. HELP is usually a more verbose help facility than /? is.


copy
copy

Once you know where to get help, the rest is easy. The whole purpose of DOS is to let you get around the directory tree easily. You use DOS to start applications (like my own P11.EXE program) and to copy files, delete files, build places to put files, and compare files, and so on. Files, Files, Files. That's what DOS is really for.

The #1 tool for file handling is the COPY command. Specify the "from" file first, then the "to" file. COPY only copies from within one directory at a time, but the "to" directory can be different. For copying entire diretory structures, use XCOPY instead.

What makes COPY so powerful is that you can use "wildcards" like * and ? within the filename.


xcopy
xcopy

Like COPY, XCOPY can use wildcards to copy a file or group of files to another directory. But XCOPY is more powerful because it has the ability to copy an entire directory structure in one command. Use the /s option to accomplish this. Use HELP XCOPY to learn more, of course!


cd (Change Directory)
cd

CD is the cold, hard way of doing things, but sometimes it's the right way. What makes it cold and hard is that in comparison to Norton's Change Directory (normally abbreviated NCD, but I abbreviated it to C on my system), the DOS CD command requires you to type the complete directory entry, all the way back to the root level! This is absurd. NCD, on the other hand, lets you type in anything that's close, and it will search your entire directory structure and plop you down right where you want to be. For example, to go to the \p11\pumps\svgapump directory, I can just type in: c svgap and immediately NCD will take me there. With CD, I would have to type cd \p11\pumps\svgapump to accomplish the same thing. Saving keystrokes is the name of the game. (That's why later in this tutorial, you'll learn to write batch files.)


md (Make Directory)
md

MD will make a new directory. You can specify the entire directory structure or just the new part, if you are already in the parent of the new part. Got that? I didn't think so. Let's say you have a directory called \animals. Let's say you are in that directory, having typed cd\animals at some point. To create the directory \dogs as a subdirectory of \animals, you can type in md dogs when you are in the \animals directory. Or, you can type in the full md \animals\dogs from any directory. However, you can't make two directory structures at once. \animals must exist before you can use MD to create \dogs.

CD and MD (and RD) are often used in conjunction with each other. If you use MD to make a new directory, to then go into that new directory, all you should have to do is just back up the command stack one command and change the M in MD to a C. (That's why you need a command stack manipulator like CED. In plain DOS, Function Key 3 will give you the last command, but only the last command. CED will go back dozens of commands.)

It's very important to understand a principal brought up in the last paragraph--that you never retype anything you don't have to. Don't be fooled into thinking it's easier to retype than to find the old command in the command stack and change a letter. First of all, it isn't. And second of all, when you get to the DELETE (DEL) command, you really need to not retype things! (read on...)


rd (Remove Directory)
rd

When you empty a directory and wish to remove it entirely, you can use RD. RD will not delete the entries (files) in a directory. They must already be deleted (the directory must be empty) for RD to work. However, these two steps can be simplified by doing them in order. Use the DEL command (described below) and then bring the command line back (using your command stack manipulator). Change DEL to RD and a space character. That way, you can be sure that you will remove the exact directory you just emptied, because you don't retype the directory name. Actually, it's normally a three-step process, since you would normally start with DIR filename, then change DIR to DEL filename, and then change DEL to RD and a space.

For example, to remove the contents from the directory BARNEY and then remove BARNEY, use the following three commands. Bring them back each time with your command stack manipulator, and just change DIR to DEL and then DEL to RD and a space:

dir barney
del barney
rd barney

You could, in theory, also use the command DELTREE to remove both the contents and the directory. You could, but you should refrain from doing that, because DELTREE is a dangerous command and should be used slowly, carefully, and sparingly. It should be a special occasion to use DELTREE, but RD is an everyday thing.


dir (Directory)
dir

DIR is the DOS way of getting a listing of a directory. Incredibly weak, it nevertheless has the advantage of being exactly like DEL in the way it handles wildcards and directories. Therefore, you can type in DIR *.txt, and it will list all the files that end with an extention of .txt, and after you see that that's what you want, you can change the DIR to DEL after retrieving the command back, and you know that you'll delete only what you want. And save keystrokes too!


ren (Rename)
ren (oldname) (newname)

REN is short for RENAME. You can rename any file or files to any valid, unused name(s). Wildcards work fine. You could rename a file by first copying it and then deleting the original, but this means you would use the more dangerous DEL command. Never use DEL if you don't have to! REN gives you a way not to use DEL. As an added benefit, REN is faster than COPY/DEL, especially if it's a big file or group of files.


del (Delete)
del

DEL is the electronic equivalent of a paper shredder. The only way to recover files you have accidentally DEL'ed to death is with some complicated software program that MIGHT or MIGHT NOT work, but then again it might give you new gibberish. And if you DEL'ed star-dot-star (*.*) you can pretty much forget most UNDELETE software programs from succeeding. Think of DEL as short for DISASTER IF I DIDN'T MEAN THIS.

That being said, of course, DEL is the standard way of deleting things. But because it's so final, you should almost always use DIR before you use DEL. Here's the plan: first, use DIR to view the filenames you wish to delete. Next, use your command-line buffer to get the same command back, and type DEL over DIR. That way, you will be absolutely sure that you will only DEL the things you just looked at with DIR. It's faster too, usually, than retyping the thing you want to delete. But even if it weren't, this is the best way to delete things.

By the way, whenever you type in DEL *.*, you should always take your hands away from the keyboard and review what you are doing. Are you on the right drive and in the right directory? Do you really want to do this? Same is true for any DEL command with wildcards, at least pause for a second or two, especially since the file recovery programs I mentioned work much more reliably if you just need to recover a single file, but if you need to recover multiple files, they are much less successful.


deltree (Delete Tree)
deltree

CAUTION!!!

DELTREE is brutal and can really mess you up. Its power is of course, its virtue. With DELTREE you essentially combine the DEL *.* command with the RD command, but it's even better because you can delete all the subdirectories as well, all in one swoop. Definitely this is a good command to know and respect. ALWAYS pause before hitting the ENTER key with this command! I literally take my hands away from the keyboard and read the line before I press ENTER when I use this command!


fc (File Compare)
fc

FC is short for FILECOMP, or FILE COMPARE. You should always use this command to compare files that are really important to you when you create a new copy. If you duplicate software, use FC to be sure that the "masters" for the manufacturer or distributor are the same as your own masters. FC takes too long, and systems are too reliable, to use it all the time, for everything. Besides, when copying files on your hard disk this command is not usually needed because a similar command takes its place: In your AUTOEXEC.BAT file the command VERIFY=ON. VERIFY will normally cause DOS to read back every file it writes, every time it writes it. At least, that's what it's designed to do, but whether VERIFY always does that, with every file, on every drive, well--I'm skeptical. So I use FC when it really matters.


diskcopy
diskcopy

DISKCOPY lets you make exact copies of master diskettes. This is good for backup and small distribution purposes. If you use DISKCOPY to copy a diskette to another diskette using the same physical disk drive, then DOS will copy a piece at a time, and will prompt you to swap them back and forth until it's done. Somehow, Microsoft hasn't thought of using swap space on the hard drive so you would only have to swap the physical media once. Maybe some day it will occur to them. There are shareware and other tools to do multi-disk copies, which do use "image files" on disk, for larger runs. Beyond a few hundred copies, consider a CD master or outside disk duplicator service.


diskcomp
diskcomp

When you make a "MASTER BACKUP" disk of something really important, you should use DISKCOMP to be sure it is the same as the "ORIGINAL MASTER" diskette.


edit
edit

EDIT is a fairly lousy editor. My actual ASCII text editor of choice was an early version of BRIEF which I used for almost everything. BRIEF was text-based and the only real problem was, everyone agrees I could have used a spell-checker if it had one but hey--it was fast. And it was great for writing batch files, something you'll be introduced to later in this document. (Note: As of 1997, I moved to Boxer/TKO from David Hamel. It's everything BRIEF was, and much, much more! (Note: As of 2007, Brief does not appear to be available anymore, and I no longer do anything in DOS, so I don't use Boxer, either.))

But for those without an ASCII text editor of choice, we all have EDIT available to us from Microsoft. It beats the pants off of the old EDLIN, but if you remember EDLIN, you probably wouldn't need to be reading this.

EDIT is for writing batch files, and for editing batch files. That's about all it's good for, but you'll probably find youself using it often enough that you should get comfortable with it. Know how to delete a line, how to move around the document, how to insert and change characters, and how to copy a section. Just know how to get help in EDIT and then remember to use it when you need it. (F1 is the help key in EDIT, by the way.)


mem (Memory)
mem

A lot of problems with running programs in DOS has to do with memory, same as in Windows and just about everything else, I guess. Many programs (including ours) tell you what amount of Conventional memory and what amount of Expanded and/or Extended memory they need.

Knowing these values, you can use MEM to see if you indeed have enough memory available to run your application.

Use MEM /c|more to get more information, and have it scroll a page at a time. (See memmaker, below, to learn what to do if MEM turns up showing too little memory available.)


memmaker
memmaker

NOTE: As of Windows 95, Microsoft no longer seems to use Memmaker.

When MEM, above, reports that you don't have enough Conventional Memory, Expanded Memory, or Extended Memory, you can use MEMMAKER to (hopefully) free some memory up.

MEMMAKER is a Microsoft program that tries to place programs which are in Conventional memory somewhere else--who cares where, right? Usually it's in a place called HIGH MEMORY, or UPPER MEMORY. DOS can actually directly access one megabyte plus 64K of memory, but unfortunately useless screen modes take about 30% of that area. MEMMAKER can make more Conventional memory available by filling in some nooks and crannies in the total addressable 1 meg+64K area.


format
format

CAUTION!!!

FORMAT should be used for diskettes only. You virtually never want to FORMAT your hard drive. If you did, you'd probably start with a low-level format "just to be on the safe side" anyway. FORMAT is for diskettes only! So, NORTON came up with a nice program called SF (SAFE FORMAT) which will replace FORMAT and which will not allow you to accidentally format your hard drive. I use SF instead of FORMAT, but if you use format, you can still get the safety aspects of SF by renaming FORMAT.COM and then creating a batch file called FORMAT.BAT and placing it in the C:\DOS directory. The batch file uses the batch file command IF to only allow you to use A: or B: or a: or b:. All other "options" are invalid.


prompt
prompt

PROMPT is a little thing, but you need it. The "infamous DOS prompt" can be greatly improved. I use:

PROMPT $t $d$h$h$h $p$g

This goes in your AUTOEXEC.BAT file and will, as shown, cause DOS to display a prompt consisting of the day of the week, the date, the time to the second, the drive and current directory, and a greater-than sign. I like it that way. Knowledge is power, you know.


redirection (> and <)
redirection (> and <)

Redirection (> and <, greater-than and less-than signs) allows you to send (>) output of other commands somewhere else, or receive (<) input from somewhere else. Output is often sent to a file instead of to the screen with this option. For example to send the output of a DIR command to a file called mydir.txt, use this:

dir > mydir.txt

This would take the output of the DIR command and place it in a file called mydir.txt instead of displaying it on the screen. Use two greater-than signs (>>) to append to an existing file. You can also send output directly to the printer using the special destination name prn (or prn:).

To receive input from a file rather than from the keyboard, use < and then the name of the file which has the input lines that you want to use.


pipes (|, a vertical line)
|

Piping takes the complete output of one command and sends it to the next command (after the vertical bar). Pipes are useful for many things, but probably the most common use of pipes are with the more command to cause the output of other DOS commands to be displayed on the screen one screen at a time. For example:

mem /c|more

MORE will display the piped output of the mem command to the screen and when each screen full of information appears, MORE will wait for a keypress before displaying the next screen.


Batch Files are such simple timesavers that you'll want to be able to write and edit them yourself.

To learn to write batch files, you can download any of our demos, all of which have simple batch files to start them, and copy the code for them. It's pretty easy. Use EDIT to create batch files you need to accomplish things you do more than once or twice, or to develop series of commands you want to execute repeatedly.

Batch files don't have to be big -- I have plenty of one-line batch files which I give short names to and which might only execute one thing. Batch files can call other batch files or jump to other batch files, which increases their usefulness substantially.

Batch files are time savers and they help you to do things quickly and efficiently and the same way every time.

In order to save keystrokes, I often rename the few programs I use regularly, like BRIEF.EXE which is renamed b.exe and placed on my virtual drive for virtually instant access. (Note: as of 1997, I now use BOXER by David R. Hamel, which is started with the initials TKO. Also, like many people, I have finally made the complete switch to Windows 95 as the base operating system on the computer, and no longer make use of a virtual drive for my individual DOS sessions (since they would take too long to set up each time, and hard drives are much faster.)


Here are some brief descriptions of IF, GOTO, and SHIFT.

Note that these are specific to DOS batch files, and are not used at the command line. Also, note that both IF and SHIFT involve the variables that are available in DOS, namely %0 through %9. They contain the items between the spaces following the batch file name on the command line. For example, a DOS command line might read:

RUNPRGMS.BAT GENI MCGA

In this example there are two variables after the batch file name (RUNPRGMS.BAT).

%0 would be equal to GENI. %1 would be equal to MCGA. In a batch file, you could put the following line to use the first two variables:

P11RUN.EXE %0 %1

The command line which the executible program (P11RUN.EXE) gets would depend on the values of %0 and %1 at the time. Each parameter substitution would be separated by single spaces.


if
if

IF used in a batch file compares something on the left of a double equal sign ( == ) with something on the right. So if the thing on the left is %0 and the thing on the right is %1, then IF %0==GENI would be TRUE in the above example (the evaluator is case sensitive), and the operation that would follow it would be executed. That might be GOTO, which can follow an IF comparison, or it might be SHIFT, or many other things. You can also use IF NOT... In addition to comparing variables (strings), you can compare the ERRORLEVEL number, or do an EXIST of a file name.

It's often a good idea to check for a null variable separately. This is done by doing something like this:

IF %0.==. GOTO NOPARAMETERS


goto
goto

This will jump immediately to a label name -- but note: ONLY the first 8 characters are significant, and the first character is a : (colon), and I don't know if it's counted as one of the eight significant characters. Labels can be ahead or behind the GOTO, that is, anywhere else in the batch file.


GOTO PLACENAME

This batch file command would cause the batch file interpreter to skip forward to the named location. Locations are named with a colon in front:

:PLACENAME


shift
shift

This batch file command will shift variable %1 into variable %0, variable %2 to variable %1, variable %3 to variable %2, variable %5 to variable %4, and so on through %9. I'm not sure what happens to %9, I think it's eliminated after its value has been being moved to variable %8 (you might want to run a test to be sure of what happens) unless there were more parameters to begin with which DOS can use to fill the 10th slot, in which case, it will move a new value in. There are no parameters to the SHIFT command.


ced
or some other DOS command stack manipulator.

I used CED for a long time. Another popular command stacker is called DOSKEY, for both MS-DOS and PC-DOS. The purpose of a command stack manipulator is to let you get at previous DOS commands you typed without having to retype them. Again, plain DOS only lets you get at the very last one, which is sort of like having Alzheimer's disease. Unfortunately, if you tend to use DOS or the DOS emulator from within Windows, repeatedly running new sessions of DOS, a command stacker won't help much, because each session is completely separate.

hdir
or some other 'advanced' directory file viewer

DIR is too simple, and has no color. HDIR provides a much easier way to display a list of files in a directory and the list is much easier to read than a DIR output. There are many other similar tools. If you use HDIR, use CED's cedparms to rename HDIR as H, and put HDIR in a root directory or better yet, on a virtual drive for fast access.

Norton CD
or some other Change Directory tool

Norton's NCD is good, but again, use CED to change the name to C instead of NCD, and put it on a virtual drive on your system.

File Find tool

Norton's FF (FileFind) is good, so if you have Norton Utilities, you might as well use FF. But there are a number of shareware tools that are just as good or better. You need to be able to find any file you know the name of (or part of the name) anywhere on a disk, or even across multiple disks. You should also be able to find files with similar names so you can delete old duplicates and old work-in-progress files.


Using DOS by itself...

To actually use DOS properly, you have to have a few tools to go with it. DOS as installed by Microsoft is virtually crippled and very difficult to use.

Several companies supply the necessary tools. Some of them are free. The tools I use are not the only choices, but they are the ones listed below the list of commands, and they are each desribed below the list of command descriptions.

The thing about DOS is how quickly you can get things done. Fewer keystrokes. It's textual, and it's fast. But to be really fast and easy, it needs some help. For some reason Microsoft won't add a previous-commands buffer to DOS! (They store only the last command.) And their official policy on ced, the one I prefer, is that it doesn't work with WINDOWS. But I don't know of a better command line retrieval system the ced. CED is a good program. Microsoft should make WINDOWS work with it, or they should at least fix DOS to emulate its general capabilities.


Why I wrote this...

Someone once asked me: "Will you teach me DOS?"

So I wrote this.

This is 1996 (updated a bit in 1998 and again in 2001 (and even again, in 2010...) as I write this, and not everyone knows DOS anymore. (2010: Make that "hardly anyone has even heard of DOS these days..."). But DOS is easy to learn (2010: if you're a geek who likes to torment themselves) and it is a great way to get things done in life! (2010: ditto)

Of course, our own "P11" program and all its applications ran in DOS so we wanted people to be at least a little comfortable with it. Hence this document.

DOS is considered the bad guy, especially by people at Microsoft, who 'dis' it more than anybody, and so people are naturally a little afraid of DOS. Some people think WINDOWS is better than DOS simply because it isn't DOS.

But the beauty of DOS from a user's standpoint is that it is fast and easy to work with. The beauty from a developer's standpoint is that it allows me to easily control the entire PC hardware and virtually all of its timing capabilities.


I hope this little guide to vital DOS commands and tools will convince you that DOS is alive and well, and just dandy for all sorts of things. Please email me and let me know if it did you any good!

Many thanks to those who have offered suggestions for improving this little tome, and to the hundreds who have written letters of appreciation.
 
CSC204, DOS Basic Command
 
MS-DOS From Wikipedia, the free encyclopedia
http://en.wikipedia.org/wiki/MS-DOS


MS-DOS (pronounced /ˌɛmɛsˈdɒs/, em-es-dos; short for Micro Soft Disk Operating System) was an operating system for x86-based personal computers. It was the most commonly used member of the DOS family of operating systems, and was the main operating system for IBM PC compatible personal computers during the 1980s to the mid 1990s, until it was gradually superseded by operating systems offering a graphical user interface (GUI), in particular by various generations of the Microsoft Windows operating system.

MS-DOS grew from a 1981 request by IBM for an operating system for its IBM PC range of personal computers. Microsoft quickly bought the rights to QDOS (Quick and Dirty Operating System), also known as 86-DOS,[1] from Seattle Computer Products, and began work on modifying it to meet IBM's specification. The first edition, MS-DOS 1.0, was launched in 1982.[2] The version shipped with IBM's PCs was called PC DOS. Although MS-DOS and PC-DOS were initially developed in parallel by Microsoft and IBM, the two products eventually went their separate ways.

During its life, several competing products were released for the x86 platform,[3] and MS-DOS itself would go through eight versions, until development ceased in 2000. Ultimately it was the key product in Microsoft's growth from a programming languages company to a diverse software development firm, providing the company with essential revenue and marketing resources. It was also the underlying basic operating system on which early versions of Windows ran as a GUI.

Contents

[hide]

[edit] History

MS-DOS was a renamed form of 86-DOS — informally known as the Quick-and-Dirty Operating System or Q-DOS [2] — owned by Seattle Computer Products, written by Tim Paterson[2]. Microsoft needed an operating system for the then-new Intel 8086 but it had none available, so it licensed 86-DOS and released a version of it as MS-DOS 1.0[2]. Development started in 1981, and MS-DOS 1.0 was released with the IBM PC in 1982[2]. (86-DOS, in turn, was written as an interim replacement for the delayed CP/M-86, when Seattle Computer Products' needed an operating system to sell with their 8086 processor card for the S-100 bus.) Tim Paterson is considered the original author of DOS and he is called "The Father of DOS"[2][n 1]

Originally MS-DOS was designed to be an operating system that could run on any 8086-family computer. Each computer would have its own distinct hardware and its own version of MS-DOS, similar to the situation that existed for CP/M, and with MS-DOS emulating the same solution as CP/M to adapt for different hardware platforms. To this end, MS-DOS was designed with a modular structure with internal device drivers, minimally for primary disk drives and the console, integrated with the kernel and loaded by the boot loader, and installable device drivers for other devices loaded and integrated at boot time. The OEM would use a development kit provided by Microsoft to build a version of MS-DOS with their basic I/O drivers and a standard Microsoft kernel, which they would typically supply on disk to end users along with the hardware. Thus, there were many different versions of "MS-DOS" for different hardware, and there is a major distinction between an IBM-compatible (or ISA) machine and an MS-DOS [compatible] machine. Some machines, like the Tandy 2000, were MS-DOS compatible but not IBM-compatible, so they could only run software written exclusively for MS-DOS without dependence on the peripheral hardware of the IBM PC architecture.

This design would have worked well for compatibility, if application programs had only used MS-DOS services to perform device I/O, and indeed the same design philosophy is embodied in Windows NT (see Hardware Abstraction Layer). However, in MS-DOS's early days, the greater speed attainable by programs through direct control of hardware was of particular importance, especially for games, which often pushed the limits of their contemporary hardware. Very soon an IBM-compatible architecture became the goal, and before long all 8086-family computers closely emulated IBM's hardware, and only a single version of MS-DOS for a fixed hardware platform was needed for the market. This version is the version of MS-DOS that is discussed here, as the dozens of other OEM versions of "MS-DOS" were only relevant to the systems they were designed for, and in any case were very similar in function and capability to the same-numbered standard version for the IBM PC, with a few notable exceptions.

While MS-DOS appeared on PC clones, true IBM computers used PC DOS, a rebranded form of MS-DOS. Ironically, the dependence on IBM-compatible hardware caused major problems for the computer industry when the original design had to be changed. For example, the original design could support no more than 640 kilobytes of memory (the 640 kB barrier), because IBM's hardware design reserved the address space above this limit for peripheral devices and ROM. Manufacturers had to develop complicated schemes (EMS and XMS, and other minor proprietary ones) to access additional memory. This limitation would not have been a problem if the original idea of interfacing with hardware through MS-DOS had endured. (However, MS-DOS was also a real-mode operating system, and the Intel x86 architecture only supports up to 1 MB of memory address space in Real Mode, even on Pentium 4 and later x86 CPUs, so for simple access to megabytes of memory, MS-DOS would have had to be rewritten to run in 80286 or 80386 Protected Mode.) Also, Microsoft originally described MS-DOS as "an operating system for Intel 8086-based microcomputers", and the 8086 CPU (and its cousin the 8088) itself has only 1 MiB of total memory address space.

[edit] Versions

Microsoft licensed or released versions of MS-DOS under different names like SB-DOS or Z-DOS[3]. Competitors released DOS systems such as DR-DOS and PTS-DOS that could also run DOS applications. The following versions of MS-DOS were released to the public:[4][5]

  • MS-DOS 1.x
    • Version 1.12 (OEM) - Compaq release of PC-DOS 1.10
    • Version 1.25 (OEM) - Microsoft repackaging of PC-DOS 1.10
  • MS-DOS 2.x - Support for 10 MB Hard Disk Drives and tree-structure filing system
    • Version 2.0 (OEM)
    • Version 2.1 (OEM)
    • Version 2.11 (OEM)
    • Version 2.2 (OEM)
    • Version 2.21 (OEM)
  • MS-DOS 3.x
    • Version 3.0 (OEM) - Support for larger Hard Disk Drives
    • Version 3.1 (OEM) - Support for Microsoft Networks
    • Version 3.2 (OEM)
    • Version 3.21 (OEM)
    • Version 3.25 (OEM)
    • Version 3.3 (OEM)
    • Version 3.3a (OEM)
    • Version 3.3r (OEM)
    • Version 3.31 (OEM) - Compaq 3.31 supports FAT16 and larger drives.
    • Version 3.35 (OEM)
  • MS-DOS 4.x - includes a graphical/mouse interface.
    • Version 4.01 (OEM) - IBM patched Version 4.00 before Microsoft released it.
  • MS-DOS 5.x
    • Version 5.0 (Retail) - includes a full-screen editor. A number of bugs required reissue.
    • Version 5.0a (Retail) - With this release, IBM and Microsoft versions diverge.
    • Version 5.0.500 (WinNT) - All Windows NT 32-bit versions ship with files from DOS 5.0
  • MS-DOS 6.x
    • Version 6.0 (Retail) - Online help through QBASIC. Disk compression and antivirus included.
    • Version 6.2 (Retail) - Microsoft and IBM alternate versions, IBM has 6.1, 6.3
    • Version 6.21 (Retail) - Stacker-infringing DBLSPACE removed.
    • Version 6.22 (Retail) - New DRVSPACE compression.
  • MS-DOS 7.x
    • Version 7.0 (Win95,95A) - Support for long file names. New editor.
    • Version 7.1 (Win95B-Win98SE) - Support for FAT32 file system
  • MS-DOS 8.0
    • Version 8.0 (WinME) - Integrated drivers for faster Windows loading.
    • Version 8.0 (WinXP) - DOS boot disks created by XP and later contain files from WinME. The internal DOS is still 5.0

Microsoft DOS was released through the OEM channel, until DRI released DR-DOS 5.0 as a retail upgrade. With PC-DOS 5.00.1, the IBM-Microsoft agreement started to end, and IBM entered the retail DOS market with IBMDOS 5.00.1, 5.02, 6.00 and PC-DOS 6.10, 6.30, 7.00 and 2000.

A number of beta versions have surfaced on the Internet, such as 5.0 (a ten-diskette version in the same vein as 4.0), 7.00 beta 1 (based on 6.00), 7.00 beta 2 (based on 6.22). An OEM source package for 6.00, and a late release of 6.2(b) have also been seen. These are not retail versions.

[edit] Competition

The original MS-DOS advertisement in 1981.

On microcomputers based on the Intel 8086 and 8088 processors, including the IBM PC and clones, the initial competition to the PC DOS/MS-DOS line came from Digital Research, whose CP/M operating system had inspired MS-DOS. In fact, there remains controversy as to whether Q-DOS was more or less plagiarised from early versions of CP/M code. Digital Research released CP/M-86 a few months after MS-DOS, and it was offered as an alternative to MS-DOS and Microsoft's licensing requirements, but at a higher price. Executable programs for CP/M-86 and MS-DOS were not interchangeable with each other; much applications software was sold in both MS-DOS and CP/M-86 versions until MS-DOS became preponderant (later Digital Research operating systems could run both MS-DOS and CP/M-86 software). MS-DOS supported the simple .COM and the more advanced relocatable .EXE executable file formats; CP/M-86 a relocatable format using the file extension .CMD.

Most of the machines in the early days of MS-DOS had differing system architectures and there was a certain degree of incompatibility, and subsequently vendor lock-in. Users who began using MS-DOS with their machines were compelled to continue using the version customized for their hardware, or face trying to get all of their proprietary hardware and software to work with the new system.

In the business world the 808x-based machines that MS-DOS was tied to faced competition from the Unix operating system which ran on many different hardware architectures. Microsoft itself sold a version of Unix for the PC called Xenix.

In the emerging world of home users, a variety of other computers based on various other processors were in serious competition with the IBM PC: the Apple II, early Apple Macintosh, the Commodore 64 and others did not use the 808x processor; many 808x machines of different architectures used custom versions of MS-DOS. At first all these machines were in competition. In time the IBM PC hardware configuration became dominant in the 808x market as software written to communicate directly with the PC hardware without using standard operating system calls ran much faster, but on true PC-compatibles only. Non-PC-compatible 808x machines were too small a market to have fast software written for them alone, and the market remained open only for IBM PCs and machines that closely imitated their architecture, all running either a single version of MS-DOS compatible only with PCs, or the equivalent IBM PC DOS. Most clones cost much less than IBM-branded machines of similar performance, and became widely used by home users, while IBM PCs had a large share of the business computer market.

Microsoft and IBM together began what was intended as the follow-on to MS/PC DOS, called OS/2. When OS/2 was released in 1987, Microsoft began an advertising campaign announcing that "DOS is Dead" and stating that version 4 was the last full release. OS/2 was designed for efficient multi-tasking — an IBM speciality derived from deep experience with mainframe operating systems — and offered a number of advanced features that had been designed together with similar look and feel; it was seen as the legitimate heir to the "kludgy" DOS platform.

MS-DOS had grown in spurts, with many significant features being taken or duplicated from Microsoft's other products and operating systems. MS-DOS also grew by incorporating, by direct licensing or feature duplicating, the functionality of tools and utilities developed by independent companies, such as Norton Utilities, PC Tools (Microsoft Anti-Virus), QEMM expanded memory manager, Stacker disk compression, and others.

During the period when Digital Research was competing in the operating system market some computers, like Amstrad PC-1512, were sold with floppy disks for two operating systems (only one of which could be used at a time), MS-DOS and CP/M-86 or a derivative of it. Digital Research produced DOS Plus, which was compatible with MS-DOS 2.11, supported CP/M-86 programs, had additional features including multi-tasking, and could read and write disks in CP/M and MS-DOS format.

While OS/2 was under protracted development, Digital Research released the MS-DOS compatible DR-DOS 5, which included features only available as third-party add-ons for MS-DOS (and still maintained considerable internal CP/M-86 compatibility). Unwilling to lose any portion of the market, Microsoft responded by announcing the "pending" release of MS-DOS 5.0 in May 1990. This effectively killed most DR-DOS sales until the actual release of MS-DOS 5.0 in June 1991. Digital Research brought out DR-DOS 6, which sold well until the "pre-announcement" of MS-DOS 6.0 again stifled the sales of DR-DOS.

Microsoft had been accused of carefully orchestrating leaks about future versions of MS-DOS in an attempt to create what in the industry is called FUD (fear, uncertainty, and doubt) regarding DR-DOS. For example, in October 1990, shortly after the release of DR-DOS 5.0, and long before the eventual June 1991 release of MS-DOS 5.0, stories on feature enhancements in MS-DOS started to appear in InfoWorld and PC Week. Brad Silverberg, Vice President of Systems Software at Microsoft and General Manager of its Windows and MS-DOS Business Unit, wrote a forceful letter to PC Week (November 5, 1990), denying that Microsoft was engaged in FUD tactics ("to serve our customers better, we decided to be more forthcoming about version 5.0") and denying that Microsoft copied features from DR-DOS:

"The feature enhancements of MS-DOS version 5.0 were decided and development was begun long before we heard about DR-DOS 5.0. There will be some similar features. With 50 million MS-DOS users, it shouldn't be surprising that DRI has heard some of the same requests from customers that we have." – (Schulman et al. 1994). [6]

The pact between Microsoft and IBM to promote OS/2 began to fall apart in 1990 when Windows 3.0 became a marketplace success. Much of Microsoft's further contributions to OS/2 also went in to creating a third GUI replacement for DOS, Windows NT.

IBM, which had already been developing the next version of OS/2, carried on development of the platform without Microsoft and sold it as the alternative to DOS and Windows.

[edit] Legal issues

As a response to Digital Research's DR-DOS 6.0, which bundled SuperStor disk compression, Microsoft opened negotiations with Stac Electronics, vendor of the most popular DOS disk compression tool, Stacker. In the due diligence process, Stac engineers had shown Microsoft part of the Stacker source code. Stac was unwilling to meet Microsoft's terms for licensing Stacker and withdrew from the negotiations. Microsoft chose to license Vertisoft's DoubleDisk, using it as the core for its DoubleSpace disk compression[7].

MS-DOS 6.0 and 6.20 were released in 1993, both including the Microsoft DoubleSpace disk compression utility program. Stac successfully sued Microsoft for patent infringement regarding the compression algorithm used in DoubleSpace. This resulted in the 1994 release of MS-DOS 6.21, which had disk-compression removed. Shortly afterwards came version 6.22, with a new version of the disk compression system, DriveSpace, which had a different compression algorithm to avoid the infringing code.

Prior to 1995, Microsoft licensed MS-DOS (and Windows) to computer manufacturers under three types of agreement: per-processor (a fee for each system the company sold), per-system (a fee for each system of a particular model), or per-copy (a fee for each copy of MS-DOS installed). The largest manufacturers used the per-processor arrangement, which had the lowest fee. This arrangement made it expensive for the large manufacturers to migrate to any other operating system, such as DR-DOS. In 1991, the U.S. government Federal Trade Commission began investigating Microsoft's licensing procedures, resulting in a 1994 settlement agreement limiting Microsoft to per-copy licensing. Digital Research did not gain by this settlement, and years later its successor in interest, Caldera, sued Microsoft for damages. It was believed that the settlement ran in the order of $150m, but was revealed in November 2009 with the release of the Settlement Agreement to be $280m.[citation needed]

[edit] Use of undocumented APIs

Microsoft also used a variety of tactics in MS-DOS and several of their applications and development tools that, while operating perfectly when running on genuine MS-DOS (and PC DOS), would break when run on another vendor's implementation of DOS. Notable examples of this practice included:

  • Microsoft's QuickPascal released in early 1989 was the first MS product that checked for MS-DOS by modifying the program's Program Segment Prefix using undocumented DOS functions, and then checked whether or not the associated value changed in a fixed position within the DOS data segment (also undocumented). This check also made it into later MS products, including Microsoft QuickC v2.5, Programmer's Workbench and Microsoft C v6.0[6].
  • The (once infamous) AARD code, a block of code in the Windows 3.1 beta installer. It was XOR encrypted, self-modifying, and deliberately obfuscated, using various undocumented DOS structures and functions to determine whether or not Windows really was running on MS-DOS[6].
    • Note that the Windows 3.0 beta code only gave a warning that Windows would not operate properly on a "foreign" OS. It did in fact run just fine on DR-DOS 6.0.
  • Interrupt routines called by Windows to inform MS-DOS that Windows is starting/exiting, information that MS-DOS retained in an IN_WINDOWS flag, in spite of the fact that MS-DOS and Windows were supposed to be two separate products[6].

[edit] End of MS-DOS

In 2011, MS-DOS is still used in some enterprises to run legacy applications, such as this US Navy food service management system.

Today, MS-DOS is rarely used for desktop computing. Since the release of Windows 95, it was integrated as a full product used for bootstrapping and troubleshooting, and no longer released as a standalone product.

Windows XP contains a copy of the Windows Me boot disk, stripped down to bootstrap only. This is accessible only by formatting a floppy as an "MS-DOS startup disk". Files like the driver for the CD-ROM support were deleted from the Windows ME bootdisk and the startup files (AUTOEXEC.BAT and CONFIG.SYS) no longer had a content. This modified disk was the base for creating the MS-DOS image for Windows XP. Some of the deleted files can be recovered with an undelete tool[8]. With Windows Vista the files on the startup disk are dated 18 April 2005 but are otherwise unchanged, including the string "MS-DOS Version 8 © Copyright 1981-1999 Microsoft Corp" inside COMMAND.COM.

However the only versions of DOS currently recognized as stand-alone OSs, and supported as such by the Microsoft Corporation are DOS 6.0 and 6.22, both of which remain available for download via their MSDN, volume license, and OEM license partner websites, for customers with valid login credentials.

MS-DOS is still used in embedded x86 systems due to its simple architecture, and minimal memory and processor requirements. The command line interpreter of NT-based versions of Windows, cmd.exe, maintains most of the same commands and some compatibility with DOS batch files.

[edit] The Windows command-line interface

All versions of Microsoft Windows have had an MS-DOS like command-line interface (CLI). This could run many DOS and variously Win32, OS/2 1.x and Posix command line utilities in the same command-line session, allowing piping between commands. The user interface, and the icon up to Windows 2000, followed the native MS-DOS interface.

Consumer Windows (up to 3.11, Win9x, WinME) ran as a Graphical User Interface (GUI) running on top of MS-DOS. With Windows 95, 98, and ME the MS-DOS part was integrated to give the illusion of a new operating system. The command line accessed the DOS command line (usually command.com), through a Windows module (winoldap.mod).

A new line of Windows, (Windows NT), boot through a kernel whose sole purpose is to load Windows: there is no character-mode boot similar to Consumer Windows, OS/2 or UNIX). The console runs as a Win32 session, with the default processor cmd.exe being a feature-reduced version of OS/2's version. The command session permits running of various supported command line utilities from Win32, MS-DOS, OS/2 1.x and POSIX.

The 32-bit Windows can run MS-DOS programs through the use of the NTVDM (NT Virtual DOS Machine). This launches a hacked version of MS-DOS 5.0. Launching the DOS command processor command.com creates a DOS environment that allows DOS programs to communicate with each other. It is not usually run by Windows, and the internal commands of command.com are processed by the underlying Win32 processor (usually cmd.exe, but could be 4nt).

The 32-bit CLI is usually referred to as the MS-DOS prompt. Although the binary interface is no longer that found in PC-DOS etc., it is an 'interface', and not an API. The commands typed here, the batches etc., all resemble those of MS/PC-DOS in much the same way that the Linux/UNIX commands resemble each other without underlying binary compatibility.

All versions of Windows for x86-64 and Itanium architectures no longer include the NTVDM and can therefore no longer natively run MS-DOS or 16-bit Windows applications. There are alternatives in the form of Virtual machine emulators such as Microsoft's own Virtual PC, as well as VMware, DOSBox, and others.

[edit] Legacy compatibility

The option to create a MS-DOS boot disk is still present in Windows 7.

From 1983 onwards, various companies worked on graphical user interfaces (GUIs) capable of running on PC hardware. With DOS being the dominant operating system several companies released alternate shells, e.g. Microsoft Word for DOS, XTree, and the Norton Shell. However, this required duplication of effort and did not provide much consistency in interface design (even between products from the same company).

Later, in 1985, Microsoft Windows was released as Microsoft's first attempt at providing a consistent user interface (for applications). The early versions of Windows ran on top of MS-DOS and its clones. At first Windows met with little success, but this was also true for most other companies' efforts as well, for example GEM. After version 3.0 (1990), Windows gained market acceptance.

Later versions (Windows 95, Windows 98 and Windows Me) used the DOS boot process to launch itself into protected mode. Basic features related to the file system, such as long file names, were only available to DOS when running as a subsystem of Windows. Windows NT ran independently of DOS but included a DOS subsystem so applications could run in a virtual machine under the new OS. With the latest Windows releases, even dual-booting MS-DOS is problematic as DOS may not be able to read the basic file system.

[edit] Related systems

[edit] Single-user

Several similar products were produced by other companies. In the case of PC DOS and DR-DOS, it is common but incorrect to call these "clones". Given that Microsoft manufactured PC DOS for IBM, PC DOS and MS-DOS were (to continue the genetic analogy) "identical twins" that diverged only in adulthood and eventually became quite different products. Although DR-DOS is regarded as a clone of MS-DOS, the DR-DOS versions appeared months and years before Microsoft's products. (For example, MS-DOS 4, released in July 1988, was followed by DR-DOS 5 in May 1990. MS-DOS 5 came in April 1991, with DR-DOS 6 being released the following June. MS-DOS 6 did not arrive until April 1993, with Novell DOS 7, DR-DOS' successor, following the next month.[9]) What made the difference in the end was Microsoft's desire to make MS-DOS a better platform for running Windows. Both IBM (DOS 5.02) and DRI (DOS 6 update) had to release interim releases for new undocumented Windows functionality.

These products are collectively referred to as DOS. However, MS-DOS can be a generic reference to DOS on IBM-PC compatible computers.

[edit] See also

[edit] Quotations

"IBM wanted CP/M prompts. It made me throw up." -- Tim Paterson [10]

[edit] Remarks

  1. ^ Notice that he is called the author of Dos and not the author of MS-DOS

[edit] Notes

  1. ^ "A Short History of MS-DOS". http://www.patersontech.com/Dos/Byte/History.html. Retrieved December 5, 2009. 
  2. ^ a b c d e f Conner, Doug. "Father of DOS Still Having Fun at Microsoft". Micronews. http://www.patersontech.com/Dos/Micronews/paterson04_10_98.htm. Retrieved December 5, 2009. 
  3. ^ a b Allan, Roy A. (2001). "Microsoft in the 1980's, part III 1980's — The IBM/Macintosh era". A history of the personal computer: the people and the technology. London, Ontario: Allan Pub.. p. 14. ISBN 0-9689108-0-7. http://www.retrocomputing.net/info/allan/. Retrieved December 5, 2009. 
  4. ^ http://www.emsps.com/oldtools/msdosv.htm
  5. ^ http://pcmuseum.tripod.com/dos.htm
  6. ^ a b c d Schulman, Andrew (1994). Undocumented DOS: A Programmer's Guide to Reserved MS-DOS Functions and Data Structures (2nd ed.). Addison-Wesley. ISBN 0-201-63287-X. 
  7. ^ BYTE Magazine, How Safe is Disk Compression?, February, 1994.
  8. ^ http://mirror.href.com/thestarman/winxp/winxpsd.htm
  9. ^ Timeline 1980-1993
  10. ^ Hunter, David (1983). "The Roots of DOS". Softalk for the IBM Personal Computer. http://www.patersontech.com/Dos/Softalk/Softalk.html. Retrieved 2007-06-14. 

[edit] References

Microsoft. MS-DOS 6 Technical Reference

[edit] External links


 
CSC204, DOS Basic Command
 
MS-DOS: A Brief Introduction
http://www.linfo.org/ms-dos.html

MS-DOS (Microsoft Disk Operating System) is a single-user, single-tasking computer operating system that uses a command line interface. In spite of its very small size and relative simplicity, it is one of the most successful operating systems that has been developed to date.


A Quick and Dirty History

When IBM launched its revolutionary personal computer, the IBM PC, in August 1981, it came complete with a 16-bit operating system from Microsoft, MS-DOS 1.0. This was Microsoft's first operating system, and it also became the first widely used operating system for the IBM PC and its clones.

MS-DOS 1.0 was actually a renamed version of QDOS (Quick and Dirty Operating System), which Microsoft bought from a Seattle company, appropriately named Seattle Computer Products, in July 1981. QDOS had been developed as a clone of the CP/M eight-bit operating system in order to provide compatibility with the popular business applications of the day such as WordStar and dBase. CP/M (Control Program for Microcomputers) was written by Gary Kildall of Digital Research several years earlier and had become the first operating system for microcomputers in general use.

QDOS was written by Tim Paterson, a Seattle Computer Products employee, for the new Intel 16-bit 8086 CPU (central processing unit), and the first version was shipped in August, 1980. Although it was completed in a mere six weeks, QDOS was sufficiently different from CP/M to be considered legal. Paterson was later hired by Microsoft.

Microsoft initially kept the IBM deal a secret from Seattle Computer Products. And in what was to become another extremely fortuitous move, Bill Gates, the not uncontroversial co-founder of Microsoft, persuaded IBM to let his company retain marketing rights for the operating system separately from the IBM PC project. Microsoft renamed it PC-DOS (the IBM version) and MS-DOS (the Microsoft version). The two versions were initially nearly identical, but they eventually diverged.

The acronym DOS was not new even then. It had originally been used by IBM in the 1960s in the name of an operating system (i.e., DOS/360) for its System/360 computer. At that time the use of disks for storing the operating system and data was considered cutting edge technology.

Until its acquisition of QDOS, Microsoft had been mainly a vendor of computer programming languages. Gates and co-founder Paul Allen had written Microsoft BASIC and were selling it on disks and tape mostly to PC hobbyists.

MS-DOS soared in popularity with the surge in the PC market. Revenue from its sales fueled Microsoft's phenomenal growth, and MS-DOS was the key to company's rapid emergence as the dominant firm in the software industry. This product continued to be the largest single contributor to Microsoft's income well after it had become more famous for Windows.

Subsequent versions of MS-DOS featured improved performance and additional functions, not a few of which were copied from other operating systems. For example, version 1.25, released in 1982, added support for double-sided disks, thereby eliminating the need to manually turn the disks over to access the reverse side.

Version 2.0, released the next year, added support for directories, for IBM's then huge 10MB hard disk drive (HDD) and for 360KB, 5.25-inch floppy disks. This was followed by version 2.11 later in the same year, which added support for foreign and extended characters.

Version 3.0, launched in 1984, added support for 1.2MB floppy disks and 32MB HDDs. This was soon followed by version 3.1, which added support for networks.

Additions and improvements in subsequent versions included support for multiple HDD partitions, for disk compression and for larger partitions as well as an improved disk-checking utility, enhanced memory management, a disk defragmenter and an improved text editor.

The final major version was 7.0, which was released in 1995 as part of Microsoft Windows 95. It featured close integration with that operating system, including support for long filenames and the removal of numerous utilities, some of which were on the Windows 95 CDROM. It was revised in 1997 with version 7.1, which added support for the FAT32 filesystem on HDDs.

Although many of the features were copied from UNIX, MS-DOS was never able to come anywhere close to UNIX in terms of performance or features. For example, MS-DOS never became a serious multi-user or multitasking operating system (both of which were core features of UNIX right from the start) in spite of attempts to retrofit these capabilities. Multitasking is the ability for a computer to run two or more programs simultaneously.


The Rise of the GUI

The introduction of the Apple Macintosh in 1984 brought about a surge of interest in GUIs (graphical user interfaces), and it soon became apparent that they would eventually replace command line interfaces such as that used by MS-DOS. Although many MS-DOS application programs created their own primitive GUIs, this approach required duplication of programming effort, and the lack of a consistent GUI among programs made it more difficult for users to learn new programs.

It took Microsoft years until it was able to offer a fairly high quality GUI of its own, with the introduction of Windows 95 in 1995 (or arguably with Windows 3.0 in 1990). Microsoft had also begun work on a joint project with IBM called OS/2, which was originally a protected-mode version of MS-DOS with a GUI, but Microsoft soon abandoned the project in order to devote more resources to the development of Windows NT, a completely new operating system that was independent of MS-DOS.

Protected mode and real mode are the two modes of operation supported by the Intel x86 architecture. The former enables 32-bit memory addressing, thereby permitting use of the extended memory that cannot be easily accessed from real mode. This makes it possible to assign separate memory areas to the operating system kernel (i.e., the core of the operating system) and to each process (i.e., program or task), thus resulting in much more stable multitasking than can be attained with real mode.

Early versions of Microsoft Windows ran under MS-DOS, whereas later versions were launched under MS-DOS but were then extended by going into protected mode. Windows NT and its successors, Windows 2000 and XP, do not use MS-DOS; however, they contain an emulation layer on which MS-DOS programs can be operated, mainly for backward compatibility with legacy (i.e., old) software.


DOS Commands

MS-DOS has a relatively small number of commands, and an even smaller number of commonly used ones. Moreover, these commands are generally inflexible because, in contrast to Linux and other Unix-like operating systems, they are designed to accommodate few options or arguments (i.e., values that can be passed to the commands).

Some of the most common commands are as follows (corresponding commands on Unix-like operating systems are shown in parenthesis):

CD - changes the current directory (cd)
COPY - copies a file (cp)
DEL - deletes a file (rm)
DIR - lists directory contents (ls)
EDIT - starts an editor to create or edit plain text files (vi, vim, ed, joe)
FORMAT - formats a disk to accept DOS files (mformat)
HELP - displays information about a command (man, info)
MKDIR - creates a new directory (mkdir)
RD - removes a directory (rmdir)
REN - renames a file (mv)
TYPE - displays contents of a file on the screen (more, cat)


Comparison between MS-DOS and Linux

MS-DOS and Linux have much in common, primarily because MS-DOS copied many ideas from UNIX. However, there are some very fundamental differences, including:

(1) Linux is a full-fledged multiuser, multitasking operating system, whereas MS-DOS is a single-user, single-tasking operating system.

(2) MS-DOS does not have built-in security concepts such as file-ownership and permissions, which are fundamental to Linux.

(3) Linux has an inverted tree-like filesystem in which all directories and files branch from a single directory, i.e., the root directory, and its subdirectories. MS-DOS can have multiple, independent root directories, such as A:, C:, D:, etc.

(4) Linux uses forward slashes "/" to separate directories, whereas MS-DOS uses backslashes "\" for the same purpose.

(5) Linux filenames can contain up to 255 characters. MS-DOS filenames are limited to an eight characters plus a three-character extension and have restrictions on allowable characters. Also, filenames are case-sensitive in Linux, whereas they are not in MS-DOS.

(6) Linux has a vastly richer command set than does MS-DOS, with a much greater number of commands and individual commands having greater power, flexibility and ease of use. Commands are case-sensitive in Linux, but they are not in MS-DOS.

(7) Although Linux and MS-DOS both have pipes and input/output redirection, the MS-DOS pipes use a completely different -- and inferior -- implementation.

(8) MS-DOS is not sufficiently flexible and efficient to serve as a base for a high quality, general-purpose GUI (and thus it had to be abandoned by Microsoft). In sharp contrast, Linux is an excellent base for a GUI (and it is used as a base for the X Window System, which is extremely configurable and whose already excellent performance continues to improve).


MS-DOS Clones and Emulators

The great success of MS-DOS led to the development of several similar operating systems, including DR-DOS, FreeDOS, OpenDOS and PC-DOS. The most promising of these clones is FreeDOS, which is claimed to be the only free operating system that is fully compatible with MS-DOS.

Development of FreeDOS was begun in 1994 by Jim Hall, then a physics student at the University of Wisconsin-River Falls. His motivation was Microsoft's announcement that it would stop supporting MS-DOS because of its impending replacement by Windows 95.

Like MS-DOS, FreeDOS is lean and robust, and it can run on old hardware and in embedded systems. A major improvement as compared with MS-DOS is the addition of options to the commands. Moreover, FreeDOS is released under the GPL (although some software in the distribution is covered by other licenses), thus making it ideal for bundling a version of DOS into products without having to pay royalties.

Because Linux was originally developed on PCs and at a time when MS-DOS was the dominant PC operating system, a variety of tools were developed to help developers and users bridge the gap between the two operating systems. Among them is dosemu, a DOS emulator which is included with Red Hat and other distributions and on which it is possible to run DOS programs. Emulators are also available for running DOS on other Unix-like operating systems, even on non-x86 processors.

mtools is a collection of utilities that make it easy to access an MS-DOS floppy disk from Linux by merely inserting it into the floppy disk drive and without having to use any mounting commands (which can be tricky for inexperienced users). Included in mtools are more than 20 commands, all of which are identical to their MS-DOS counterparts except that the letter m is added to the start of each of their names and forward slashes are used instead of backslashes. For example, the MS-DOS command type a:\file1.txt to display the contents of a file named file1.txt that is located on a floppy disk would become mtype a:/file1.txt.


Outlook For the Future

Although it is widely believed that MS-DOS is an antiquated and useless operating system with few features and capabilities, this is far from correct. In fact, although not generally publicized, MS-DOS is still used today by numerous businesses and individuals around the world. A good analogy is the ancient programming language COBOL (introduced in 1960!), which is still in widespread use and, amazingly, accounts for roughly half of all the computer code still in existence. Both MS-DOS and COBOL have survived for so long because they are robust, relatively simple and continue to get the job done with a minimum of maintenance.

In many cases, it was not MS-DOS itself that was the limiting factor in system performance; rather, it was the hardware, including small memories, slow CPUs and slow video cards. The capabilities of MS-DOS have, in fact, continued to increase even after Microsoft Windows became widespread. This is a result of continuing advances in the hardware and the introduction of new or improved utilities and applications. DOS as a whole is also being strengthened by the improvements that are being made to the MS-DOS clones, particularly FreeDOS.

DOS will be around for many years into the future not only because of the continued existence of legacy applications but also because of the development of new applications. The main area of growth will most likely be simple embedded applications, for which DOS is eminently well suited because of its extremely small size, very reliable operation and zero cost (in the case of FreeDOS).

DOS is so tiny, in fact, that it can fit on a single floppy disk and still leave sufficient room on the same disk for an embedded program and data files. Although there are many alternatives for embedded systems, including embedded Linux and Microsoft Windows CE, DOS can be the best choice if space is severely limited. Moreover, in contrast to FreeDOS, Windows CE has the disadvantages of not being free and having various licensing issues with which to contend.


 
CSC204, DOS Basic Command
 
DOS TUTORIAL : THE BASICS
http://terpconnect.umd.edu/~nsw/ench250/dostutor.htm


Compilation by Lisa Lemieux, UC Call Center

Table of Contents

  I. Lesson 1

  A. Hardware and Software differences.

  B. What is DOS?

  C. Why You Need DOS.

  D. Set the Date and Time.

  E. Check the Date and Time.

  II. Lesson 2

  A. Directory Command.

  B. Scroll Through the Directory Listing.

  C. Pause a Directory Listing.

  D. View a Wide Listing of Files.

  E. Recall a DOS Command.

  F. Print a Directory Listing.

  G. Check for a Single File.

  H. Check for a Group of Files.

  I. List Files with the Same Extension.

  J. Clear the Screen.

  III. Lesson 3

  A. Create a DOS File.

  B. Copy a File.

  C. Copy a File with a New Extension.

D. Type a File with DOS.

E. Rename a File

F. Rename a Group of Files

IV. Lesson 4

A. Create a Subdirectory.

B. Move to a Subdirectory.

C. Set the DOS Prompt.

D. Move to the Parent Directory.

E. Copy a File into a Subdirectory.

F. Copy a Group of Files into a Subdirectory.

G. List Files in the Root from the Subdirectory.

H. Select the Directory List.

I. List Subdirectories.

V. Lesson 5

A. Delete a Single File.

B. Delete a Group of Files.

C. Delete all Files in a Subdirectory.

D. Remove a Subdirectory.

VI. Lesson 6

A. Format a Floppy Disk.

B. Change the Default Drive.

C. Diskcopy Command.

D. Copying a File from the Hard Drive to a Floppy.



Before you begin this tutorial
, please make sure that your prompt is C:\> If it is not, please do the following:

Directions:

1. Type: c:

2. Type: cd..

This should place you into the C:\> working directory.

NOTE: DOS is not case sensitive; therefore, a command can be entered in with CAPITAL LETTERS, lower-case letters, or a MiXtuRe of the two.


 

Hardware and Software Differences

There are two parts to a computer system, the hardware and the software. Hardware refers to the physical components of a computer. An example of hardware components would be the monitor, keyboard and mouse. Software represents the programs which contain a set of instructions written to perform a certain task on the computer.

What is DOS?

DOS stands for Disk Operating System. DOS controls the computer’s hardware and provides an environment for programs to run. This system program must always be present when working with your computer.

Why You Need DOS

There are a variety of reasons why you need DOS. A few of them are listed below to satisfy your curiosity.

1. DOS controls the flow of information between you and the computer (translator).

2. DOS allows you to store information on your computer.

3. DOS allows you to retrieve information stored on your computer.

4. DOS interprets and translates the software you have on your computer.

5. DOS gives you access to all its function (i.e. saving, copying, and printing files).

Set the Date and Time

Most computers on campus have an internal clock that will automatically set the date and time for you when you turn the computer on. However, if your computer does not have this feature or your computer has two floppy drives, you will need to do the following steps to set the date and time.

Directions:

1. Type the date like this: 1-15-97

2. Press the return key (enter key).

3. Type the time like this: 8:46

4. Press return.

5. Notice that the C:\> prompt will appear.

DOS marks the date and time on everything you do. It is important to periodically check the date and time if you have an internal clock to see if it is correct. If you have a two floppy system, it is important to enter the correct date and time when you turn the computer on.

NOTE: Baynan sets the date and time for you automatically when you Login.

 Check the Date and Time

DOS will let you check or change the date and time once it has been set. The procedure to do this is as follows:

Directions:

1. Type: date and press return.

2. If the correct date is displayed, simply press return. If the date is incorrect, type the correct date and press return.

3. Type: time and press return.

4. If the correct time is displayed, simply press return. If the time is incorrect, type the correct time and press return.

Directory Command

The DIRECTORY command is like a table of contents in a book. This directory will list the following information:

Directions:

1. At the C:\> type: dir and press return.

2. The list of files will scroll up and off the screen.

NOTE: At the end of the listing, there is a line that shows the number of bytes free on the hard drive.

Scroll Through the Directory Listing

When you type the DIR command and press return, the files begin to scroll vertically on your screen. If you have a lot of files it is difficult to read each one. By holding down the Control Key (CTRL) and the letter S at the same time, you are able to freeze the listing to view your files. When you are finished, press the spacebar for the list to continue.

NOTE: You must return to the C:\> before entering your next command.

Pause a Directory Listing

You can add a PAUSE command to your directory command which will allow you to view your directory one screen at a time.

Directions:

1. Type: dir/p and press return.

2. The screen freezes after it fills the screen with the files that are listed first in the directory.

  3. Press the spacebar to continue listing you files.

  4. Continue to press the spacebar until you return back to the C:\> prompt.

 View a Wide Listing of Files

When you need to quickly view your files, you can add a /W to the directory command. This will display your files into five columns on the screen.

Directions:

  1. Type: dir/w and press return.

  2. DOS will list only the name of you file and the file extension on the screen.

 NOTE: Use this command when you are not concerned with looking at the file size or the date it was created.

 Recall a DOS Command

The F3 function key can be used to recall the last DOS command you typed in. If you would like to retrieve a previously entered command, you can also press the up arrow key continuously until you reach the desired command you were looking for.

NOTE: You can also type out each letter in your last command by using the right arrow key or the right cursor key. After you use the F3 key to recall a command, you can use the backspace key to edit any part of the command or add to your command.

Print a Directory Listing

You can print a list of your files in your directory by instructing DOS to send the information to your printer.

Directions:

  1. Type: dir>prn and press return.

  2. The > symbol stands for output. The PRN stands for printer.

 NOTE: You can print a wide listing of your files by typing dir/w>prn

Laserjet printers and other sheetfeeder printers will not eject the page after the dir>prn command. You must take the printer off-line and press the form feed button. Remember to press the on-line button when you are done in order to continue using the printer.

Check for a Single File

Instead of using the directory command to look for one particular file, you can type the name of the file after the DIR command at the C:\> prompt.

Directions:

1. Make sure that you are at your C:\> prompt.

2. Type: dir format.com (filename.extension) and press return.

3. The screen will display a listing of the file or a file not found message.

Check for a Group of Files

The * symbol is referred to as a wildcard and stands for any character or group of characters. This is helpful when you want to list files that start with a particular letter or group.

Directions:

1. Type: dir c* and press return.

2. All filenames that begin with the letter C will be listed.

3. Press the F3 key.

4. Backspace twice and replace C* with A* and press return.

5. All filenames that begin with the letter A are listed.

List Files with the Same Extensions

You can also use the wildcard character * to look for a group of files with the same extension.

Directions:

1. Type: dir *.bat and press return.

2. All files with the .bat extension are listed.

3. Press the F3 key.

4. Backspace three times and replace the .bat extension with the .sys extension and press return.

 5. All files with the .sys extension should now be listed.

Clear the Screen

When the screen get full of information, you may want to clear it. To do this, type CLS at the C:\> prompt and press return.

Create a File with DOS

Directions:

1. Type: copy con Quick.ltr and press return.

2. Type this message in the following format:

Bob

Sales are up 15%.

Good Job!

Craig

3. Press the F6 function key (^Z) and press return.

4. DOS gives you a message that 1 File(s) has been copied.

5. Type: dir q* and press return.

6. Now you can see the list of files beginning with the letter Q.

NOTE: You can also use the COPY command to print a file by typing: copy quick.ltr prn and press return.

Copy a File

You can use the COPY command to copy one file to another.

Directions:

1. Type: copy quick.ltr quick2.ltr and press return.

2. DOS will tell you one file has been copied.

3. Type: dir q* and press return.

4. You should have two files listed with different names.

NOTE: Filenames cannot be more than eight characters in length. File extensions cannot be more than three characters in length.

Copy a File with a New Extension

You can also use the COPY command to copy the file with a different filename extension.

Directions:

1. Type: copy quick.ltr quick.bac and press return.

2. Type: dir q* and press return.

3. Three files should be listed.

Type a File with DOS

If you need to check the contents of a particular file or any DOS file, you will need to use the TYPE command.

Directions:

1. Type: type quick2.ltr and press return.

2. DOS prints the contents of the file.

NOTE: Never use the TYPE command with files that have the .com, .exe, .sys, and .bas extensions. These are program files and will only display junk on the screen.

Rename a File

The RENAME command lets you rename a previous file with a new name.

Directions:

1. Type: ren quick2.ltr sales.ltr and press return.

2. Type: dir *.ltr and press return.

3. DOS lists only two files that have the .ltr extension: quick.ltr and sales.ltr.

Rename a Group of Files

With the wildcard character *, you can also use the RENAME command to change a group of files.

Directions:

1. Type: ren *.ltr *.bob and press return.

2. Type: dir *.bob and press return.

3. You should have two files listed with a .bob extension.

4. Type: dir *.ltr and press return.

5. There should be no files found with .ltr extensions.

NOTE: You can also rename a group of files that have the same name but different extensions. Type the RENAME command then the filename followed by the dot and the wildcard, space and then type the new filename followed by a dot and the wildcard character. It will look like this: filename.* newfilename.*

 Create a Subdirectory

To create a subdirectory, you will need to use the MAKE DIRECTORY command, a.k.a. MD. The MD command is useful for organizing files on your hard drive. With subdirectories, you can create and store related files together. For example, one subdirectory could be used to store all word processing files and another for all spreadsheet files.

Directions:

1. Type: md \info and press return.

2. Type: dir *. and press return.

3. Notice the *. will list only the subdirectories.

Move to a Subdirectory

Once you have created a subdirectory, to move to that directory, you will use the CHANGE DIRECTORY command, a.k.a. CD.

Directions:

1. Type: cd \info and press return.

2. Type: cd and press return.

3. The name of the directory is listed.

Set the DOS Prompt

You can set or change the standard system prompt to display the name of the directory or subdirectory you are currently working in.

Directions:

1. Type: prompt $p $g and press return.

2. The DOS prompt tells you that you are working in the C directory (drive) and in the Info subdirectory.

3. Type: dir and press return.

4. The single dot stands for the current directory. The double dots stand for the parent directory (root). The dots are often referred to as place markers.

Move to the Parent Directory

DOS has a quick way to move from the current directory back to the parent directory.

Directions:

  1. Type: cd.. and press return.

  2. You will return back to the C:\> prompt.

 Copy a File into a Subdirectory

The COPY command lets you copy files from one directory to another.

Directions:

1. Type: copy sales.bob \info and press return.

2. Type: dir \info and press return.

3. Notice that a copy of Sales.bob is copied into the subdirectory Info. The original file is also in the root directory.

Copy a Group of Files into a Subdirectory

When copying a group of files from the root directory into a subdirectory, it is necessary to use the wildcard character * along with the COPY command.

Directions:

1. Type: copy quick.* \info and press return.

2. DOS will list the files being copied.

3. Type: dir \info and press return.

4. Three files should be listed in the Info subdirectory.

List Files in a Subdirectory

The CHANGE DIRECTORY, a.k.a. CD, command will let you list files in your subdirectory from your hard drive.

Directions:

1. Type: cd \info and press return.

2. Type: dir and press return.

3. All files in the Info subdirectory are listed.

List Files in the Root from a Subdirectory

The DIRECTORY command is also used to get a listing of all the files in the root directory while in a subdirectory. The backslash character \ represents the root directory.

Directions:

1. Type: dir \ and press return.

2. All the files in the root directory are listed.

Select the Directory List

To look for a specific filename extension, you can use the SELECTED DIRECTORY command.

Directions:

1. Type: dir \*.bat and press return.

2. Only the files with the .bat extensions are listed.

3. Press the F3 key.

4. Backspace three times.

5. Type: sys and press return.

6. Now only the files with the .sys extensions are listed.

List Subdirectories

Directions:

1. Type: dir \*. and press return.

2. All the subdirectories are listed.

NOTE: The backslash character \ directs DOS to read from the root directory. The *. requests the listing of the subdirectories.

Delete a Single File

Periodically it is a good idea to delete files from the hard disk which are no longer needed or used. DOS makes it easy to remove these files with the DELETE command, a.k.a. DEL.

Directions:

1. Type: cd.. and press return.

2. The prompt shows you that you are back in the root directory.

3. Type: del sales.bob and press return.

4. Type: dir Sales.bob and press return.

5. Sales.bob is no longer listed because it has been deleted.

Delete a Group of Files

By using the wildcard character * you can delete a group of files from you hard drive.

Directions:

1. Type: del quick.* and press return.

2. Type: dir quick.* and press return.

3. All Quick files have been deleted.

Delete all Files in a Subdirectory

There are two rules you will need to follow before removing a subdirectory.

RULE 1: All files in the subdirectory must be deleted.

NOTE: Never type DEL *.* when you are in the root directory. It will destroy all DOS files that are necessary to boot and operate the computer.

Directions:

1. Type: cd \info and press return.

2. Type: dir and press return.

3. Three files should be listed.

4. Type: del *.* and press return.

5. DOS will ask you if you are sure? (Y/N)

  6. Type: Y and press enter.

  Now that your subdirectory is empty, you can delete the subdirectory (see rule 2 below).

Remove a Subdirectory

RULE 2: You cannot be in the subdirectory that you wish to remove. You will need to return to the root directory (C:\> prompt).

  Directions:

  1. Type: cd.. and press return.

  2. You should be back in the root directory.

  3. Type: rd \info and press return.

  4. Type: dir *. and press return.

  5. Notice that the Info subdirectory is no longer listed.

Format a Floppy Disk

Before you can use a disk, you must format it.

Directions:

1. At the C:\> prompt type: format a:

2. The A drive will be the drive that you insert your disk into; hence, the a: after the Format command and press return.

3. You will be prompted with the message: "Insert new diskette for drive A: and press enter when ready."

4. Now insert the disk you wish to format and press return.

5. Once this formatting process is done, the following message will appear: "Format Completed." Then you will be prompted for a volume label. Simply press return again.

6. Now you will be asked if you would like to format another disk (Y/N)? Press N.

NOTE: If you receive a message like: "Track 0 bad" or "Disk unusable," your disk may be the wrong capacity. You can get help with this error message by typing:

Help Format.

Change the Default Drive

To change from your hard drive to a floppy drive, you will need to indicate this change as follows:

Directions:

1. Put a floppy disk into drive A.

2. Type: a: and press return.

3. Your prompt should change to A:\>

4. Type: dir and press return.

5. You are now able to see all the files on the floppy.

6. To change back to your hard drive, you will need to reverse this procedure.

7. Type: c: and press return. Now your prompt should be C:\>

Diskcopy Command

Sometimes there is a need to copy all the files on one floppy diskette to another floppy. First you will need a blank formatted disk (refer to section on formatting disks.)

Directions:

  1. Type: diskcopy a: a: and press return.

  2. When asked to put in the source disk, put in the diskette that has the information you want to copy into drive A and press return.

3. Wait a few seconds. When asked to insert a target disk, take out the diskette from drive A and insert the blank floppy disk and press return.

4. Once this process is complete, you will be prompted to write to another duplicate diskette (Y/N). Press N.

 5. Then you will be prompted to copy another disk (Y/N)? Press N.

NOTE: If your machine has two floppy disk drives, insert the original (source) disk into drive A and the blank (target) disk into drive B. Then type: DISKCOPY A: B:

Copying a File from the Hard Drive to a Floppy Disk

Sometimes there is a need to copy a file from the hard drive onto a floppy disk. This is helpful if you would like to have an extra copy of a certain file as a backup or to transport the copied file to another computer.

Directions:

1. Type: copy <insert filename here> a: and press return.

2. Wait for a few seconds, notice the red light on the floppy drive. Never attempt to remove a disk from the disk drive while this red light is on.

3. To check to see if the file was copied, type a: at the C:\> prompt and press return.

4. Type: dir and press return.


 
CSC204, DOS Basic Command
 
VMware From Wikipedia, the free encyclopedia
http://en.wikipedia.org/wiki/VMware


VMware, Inc. (NYSEVMW) is a company providing virtualization software[1][2][3] founded in 1998 and based in Palo Alto, California, USA. It is majority owned by EMC Corporation (NYSEEMC).

VMware's desktop software runs on Microsoft Windows, Linux, and Mac OS X, while VMware's enterprise software hypervisors for servers, VMware ESX and VMware ESXi are bare-metal embedded Hypervisors that run directly on server hardware without requiring an additional underlying operating system.[4]

Contents

[hide]

[edit] History

In 1998, VMware was founded by Diane Greene, Mendel Rosenblum, Scott Devine, Edward Wang, & Edouard Bugnion. Greene & Rosenblum, who are married, first met while at the University of California, Berkeley.[5] Edouard Bugnion remained the chief architect and CTO of VMware until 2005,[6] and went on to found Nuova Systems (now part of Cisco).

The company has its headquarters in Palo Alto, California, United States, and established an R&D Center in Cambridge, Massachusetts, as well as one at the Time Warner Center in New York City, in 2005. VMware software runs on Windows and on Linux, and made its debut on Mac OS X in December, 2006.

VMware operated throughout 1998 in stealth mode with roughly 20 employees by the end of that year. The company was launched officially in February 1999 at the DEMO Conference organized by Chris Shipley.[7]

VMware delivered its first product, VMware Workstation, in May 1999[8] and entered the server market in 2001 with VMware GSX Server (hosted) and VMware ESX Server (hostless).[9] In 2003 VMware launched VMware Virtual Center, the VMotion and Virtual SMP technology. 64-bit support appeared in 2004. The company was also acquired by EMC Corporation that same year for $625 million.[10]

In June 2006, VMware acquired privately-held Akimbi Systems.[11]

In August 2007, EMC Corporation released 10% of the company's shares in VMware in an initial public offering on the New York Stock Exchange. The stock debuted at 29 USD per share and closed the day at 51 USD.[12]

On July 8, 2008, VMware co-founder, president and CEO Diane Greene was unexpectedly fired by the VMware Board of Directors and replaced by Paul Maritz, a retired 14-year Microsoft veteran who was heading EMC's cloud computing business unit.[13] In the same news release VMware stated that 2008 revenue growth will be "modestly below the previous guidance of 50% growth over 2007." As a result, market price of VMware dropped nearly 25%. Then on September 10, 2008, Rosenblum, the company's chief scientist, resigned from VMware.

On September 16, 2008, VMware announced that they are collaborating with Cisco to provide joint data center solutions. One of the first results of this is the Cisco Nexus 1000V, a distributed virtual software switch that will be an integrated option in the VMware infrastructure.[14]

VMware acquired Tungsten Graphics, a company with core expertise in 3D graphics driver development on November 26, 2008.[15]

On August 10, 2009, VMware announced the acquisition of SpringSource, a leader in enterprise and web application development and management.[16] The acquisition is seen by the industry as a strategic move of VMware to become a leader in offering Platform as a Service (PaaS). The acquisition also resulted in the expansion of VMware's education services portfolio by the inclusion of SpringSource University and its authorized training partner - SpringPeople Technologies.

On Tuesday, January 12, 2010, VMware acquired Zimbra, an open-source collaboration software tool, from Yahoo.

On Thursday, May 6, 2010, VMware acquired GemStone, to be operated under VMware's SpringSource division.

[edit] Core product design

VMware software provides a completely virtualized set of hardware to the guest operating system.[17] VMware software virtualizes the hardware for a video adapter, a network adapter, and hard disk adapters. The host provides pass-through drivers for guest USB, serial, and parallel devices. In this way, VMware virtual machines become highly portable between computers, because every host looks nearly identical to the guest. In practice, a system administrator can pause operations on a virtual machine guest, move or copy that guest to another physical computer, and there resume execution exactly at the point of suspension. Alternately, for enterprise servers, a feature called VMotion allows the migration of operational guest virtual machines between similar but separate hardware hosts sharing the same storage. Each of these transitions is completely transparent to any users on the virtual machine at the time it is being migrated.

VMware Workstation, Server, and ESX take a more optimized path to running target operating systems on the host than emulators (such as Bochs) which simulate the function of each CPU instruction on the target machine one-by-one, or dynamic recompilation which compiles blocks of machine-instructions the first time they execute, and then uses the translated code directly when the code runs subsequently. (Microsoft Virtual PC for Mac OS X takes this approach.) VMware software does not emulate an instruction set for different hardware not physically present. This significantly boosts performance,[18] but can cause problems when moving virtual machine guests between hardware hosts using different instruction-sets (such as found in 64-bit Intel and AMD CPUs), or between hardware hosts with a differing number of CPUs. Stopping the virtual-machine guest before moving it to a different CPU type generally causes no issues.

VMware's products, which compete with those from companies such as Citrix and Microsoft, use the CPU to run code directly whenever possible (as, for example, when running user-mode and virtual 8086 mode code on x86). When direct execution cannot operate, such as with kernel-level and real-mode code, VMware products re-write the code dynamically, a process VMware calls "binary translation" or BT. The translated code gets stored in spare memory, typically at the end of the address space, which segmentation mechanisms can protect and make invisible. For these reasons, VMware operates dramatically faster than emulators, running at more than 80% of the speed that the virtual guest operating-system would run directly on the same hardware. In one study VMware claims a slowdown over native ranging from 0–6 percent for the VMware ESX Server.[19]

VMware's approach avoids some of the difficulties of virtualization on x86-based platforms. Virtual machines may deal with offending instructions by replacing them, or by simply running kernel-code in user-mode. Replacing instructions runs the risk that the code may fail to find the expected content if it reads itself; one cannot protect code against reading while allowing normal execution, and replacing in-place becomes complicated. Running the code unmodified in user-mode will also fail, as most instructions which just read the machine-state do not cause an exception and will betray the real state of the program, and certain instructions silently change behavior in user-mode. One must always rewrite; performing a simulation of the current program counter in the original location when necessary and (notably) remapping hardware code breakpoints.

Although VMware virtual machines run in user-mode, VMware Workstation itself requires the installation of various drivers in the host operating-system, notably to dynamically switch the Global Descriptor Table (GDT) and the Interrupt Descriptor Table (IDT).

The VMware product line can also run different operating systems on a dual-boot system simultaneously by booting one partition natively while using the other as a guest within VMware Workstation.

[edit] Technology Architecture

[edit] Products

[VMware vSphere, a holistic view]

vCenter Server ($)

(license manager)

Server

Hardware

ESX ($)

(vMotion, DRS, HA, Storage vMotion)

Guest OS

Guest OS

Guest OS...

ESXi (freeware)
(ESXi freeware is managed by the Virtual Infrastructure (or vSphere) Client)
ESXi ($)
(vMotion, DRS, HA, Storage vMotion)

Guest OS

Guest OS

Guest OS...

Workstation

Hardware

Windows or

Linux OS

VMware Server (freeware)

Guest OS

Guest OS

Guest OS...

User

Session

VMware Workstation ($)

VMware Player (freeware)

vSphere Client for managing ESX(i) hosts (freeware)


[edit] Desktop software

  • VMware Workstation (first product launched by VMware in 1999). This software suite allows users to run multiple instances of x86 or x86-64 -compatible operating systems on a single physical PC.
  • VMware Fusion provides similar functionality for users of the Intel Mac platform, along with full compatibility with virtual machines created by other VMware products.
  • VMware Player For users without a license to use VMware Workstation or VMware Fusion, VMware offers this software as freeware product for personal use. While initially not able to create virtual machines, this limitation was removed in version 3.0.1

[edit] Server software

VMware markets two virtualization products for servers:

  • VMware ESX (formerly called "ESX Server"), an enterprise-level product, can deliver greater performance than the freeware VMware Server, due to lower system overhead. VMware ESX is a "bare-metal" product, running directly on the server hardware, allowing virtual servers to also use hardware more or less directly. In addition, VMware ESX integrates into VMware vCenter, which offers extra services to enhance the reliability and manageability of a server deployment, such as
    • VMotion - the capability to move a running virtual machine from one ESX host to another and faster than some other editions
    • Storage VMotion - the capability to move a running virtual machine from one storage device to another
    • DRS - Dynamic Resource Scheduler - automatic load balancing of a ESX cluster using VMotion
    • HA - High Availability - In case of hardware failure in a cluster, the virtual servers will automatically restart on another host in the cluster
  • VMware ESXi (formerly called "VMware ESX 3i"), is quite similar to ESX, but differentiates in that the Service Console is removed, and replaced with a minimal BusyBox installation. Disk space requirements are much lower than for ESX and the memory footprint is reduced. ESXi is intended to be run from flash disks in servers but can be run from normal disks. VMware ESXi hosts can't be managed directly from the console, all management is performed through a VirtualCenter Server.[24] In July 2008, VMware decided to give ESXi away for free.
  • VMware Server (formerly called "GSX Server", now obsolete[25]) is also provided as freeware for non-commercial use, like VMware Player, and it is also possible to create virtual machines with it. It is a "hosted" application, which runs within an existing Linux or Windows operating system.

[edit] Other products

VMware ThinApp, one of the most recent products from the company

VMware vCenter Converter (VMware Converter) comes in both Enterprise ($, bundling and entitlement with vCenter Server) and Standalone (free) versions and is designed primarily for the following tasks:[26]

  • Convert a physical machine into a virtual machine; referred to as Physical-to-Virtual or P2V.
  • Convert a virtual machine of one type into another (V2V)
  • Run automated configuration tasks on VMware ESX/ESXi servers.

Converted VMs are compatible with VMware ESX/ESXi, VMware Server and VMware Workstation. A P2V conversion can be done from any physical machine running Microsoft Windows (XP or later) or Linux based (Linux only works on Standalone version). Conversions can be managed from a centralized console allowing for multiple conversions at the same time (using the Enterprise version). VMware vCenter Converter replaces the older VMware products "P2V Assistant" and "Importer". P2V Assistant allowed users to convert physical machines into virtual machines; and Importer allowed the import of virtual machines from other products into VMware Workstation.

VMware Capacity Planner, an information technology (IT) capacity planning tool, collects utilization-data in heterogeneous computing environments and compares it to industry-standard reference-data to provide analysis and decision-support modeling.

VMware ACE provides a means of distributing secured virtual desktops to networked client PCs.

VMware ThinApp, formerly Thinstall, is a virtualization suite capable of creating portable software ("portable apps"). This software enables applications to execute without being previously installed.

VMware Infrastructure is a collection of VMware products used to manage a VMware ESX/ESXi server environment.

VMware vSphere is a "cloud OS". VMware vSphere 4 was originally named VMware Virtual Infrastructure (VI) 4 and is capable of managing large pools of infrastructure, including software and hardware[27] both from internal and external networks.

The VMware Tools package adds drivers and utilities to improve the graphical performance for different guest operating systems, including mouse tracking. The package also enables some integration between the guest and host systems, including shared folders, plug-and-play devices, clock synchronisation, and cutting-and-pasting across environments. VMware Inc makes VMware Tools available for Microsoft Windows, Linux, Sun Solaris, FreeBSD, and Novell NetWare guest systems.[28]

On September 11 at VMworld 2007, VMware announced that large portions of VMware Tools for Linux, Solaris, and FreeBSD guests were released under GPL and GPL-compatible licenses. They also announced the creation of the Open Virtual Machine Tools ("open-vm-tools") project on Sourceforge.net.[29]

VMware's promontory headquarters at 3401 Hillview Avenue in Palo Alto, California

[edit] See also

[edit] References

  1. ^ "VMware leader in virtualization market". http://www.hostreview.com/icontent/the-blog/vmware-leader-virtualization-market. 
  2. ^ Lohr, Steve (2009-08-31). "VMware market share more than 80%". The New York Times. http://www.nytimes.com/2009/08/31/technology/business-computing/31virtual.html?pagewanted=2&_r=2&partner=rss&emc=rss. Retrieved 2010-05-27. 
  3. ^ "VMware, Hyper-V virtualization leave others in the dust". http://searchservervirtualization.techtarget.com/news/article/0,289142,sid94_gci1369150,00.html. 
  4. ^ "ESX Server Architecture". Vmware.com. http://www.vmware.com/support/esx21/doc/esx21_admin_system_architecture.html. Retrieved 2009-10-22. [dead link]
  5. ^ Adam Lashinksky (2007-10-02). "50 Most Powerful Women in Business - Full speed ahead". CNN. http://money.cnn.com/magazines/fortune/fortune_archive/2007/10/15/100536853/index.htm. "In 1988 she picked up a second master's, in computer science, at the University of California at Berkeley, where she met Rosenblum" 
  6. ^ "Edouard Bugnion lives in the virtual world". http://www.infoworld.com/article/04/01/23/04FEctoedouard_1.html?s=feature. 
  7. ^ "VMware Milestones". http://www.vmware.com/company/mediaresource/milestones.html. 
  8. ^ "VMware company history". http://www.vmware.com/company/mediaresource/milestones.html. 
  9. ^ "VMware ready to capitalize on hot server market". June 30, 2000. http://news.cnet.com/2100-1001-242656.html. 
  10. ^ http://www.vmware.com/company/news/releases/emc2.html
  11. ^ "VMware Advances Software Lifecycle Management". 
  12. ^ Mullins, Robert (2007-08-14). "Update: VMware the bright spot on a gray Wall Street day". IDG News Service. http://www.infoworld.com/article/07/08/14/VMware-the-bright-spot-on-a-gray-Wall-Street-day_1.html. Retrieved 2007-08-15. 
  13. ^ Name : (2008-07-08). "Tech Trader Daily - Barron’s Online : VMware Ousts CEO Diane Greene; Cuts '08 Guidance". Blogs.barrons.com. http://blogs.barrons.com/techtraderdaily/2008/07/08/vmware-ousts-ceo-diane-greene-cuts-08-guidance/. Retrieved 2009-07-01. 
  14. ^ "Virtual Networking Features of the VMware vNetwork Distributed Switch and Cisco Nexus 1000V Series Switches". http://www.vmware.com/files/pdf/technology/cisco_vmware_virtualizing_the_datacenter.pdf. 
  15. ^ David Marshall (2008-12-16), VMware's year end acquisition of Tungsten Graphics, InfoWorld, http://www.infoworld.com/d/virtualization/vmwares-year-end-acquisition-tungsten-graphics-196 
  16. ^ "VMware to Acquire SpringSource". http://www.vmware.com/company/news/releases/springsource.html. 
  17. ^ "How does VMWare Work?". Extremetech.com. 2009-06-22. http://www.extremetech.com/article2/0,2845,1624080,00.asp. Retrieved 2009-07-01. 
  18. ^ "Benchmarking VMware ESX Server 2.5 vs Microsoft Virtual Server 2005 Enterprise Edition". Virtualization Benchmark Review. 2006-04-19. http://capitalhead.com/articles/benchmarking-vmware-esx-server-25-vs-microsoft-virtual-server-2005-enterprise-edition.aspx. Retrieved 2009-06-11. 
  19. ^ "A Performance Comparison of Hypervisors". http://www.vmware.com/pdf/hypervisor_performance.pdf. 
  20. ^ "Diagram: VMware ESX Memory Management and Monitoring"
  21. ^ "Diagram: VMware Fault Tolerance"
  22. ^ "Diagram: VMware High Availability"
  23. ^ "Diagram: VMware vNetwork Distributed Switch"
  24. ^ "The Architecture of VMware ESXi". VMware. http://www.vmware.com/files/pdf/vmware_esxi_architecture_wp.pdf. 
  25. ^ "VMware Products Life Cycle Policies". VMware. http://www.vmware.com/support/policies/lifecycle/general/index.html. 
  26. ^ VMware Converter. Retrieved 2008-03-31.
  27. ^ "VMware vSphere". VMware. http://www.vmware.com/products/vsphere/. 
  28. ^ "Installing and Upgrading VMware Tools". Workstation User’s Manual. VMware, Inc.. 2007-09-20. http://www.vmware.com/pdf/ws6_manual.pdf. Retrieved 2007-11-02. 
  29. ^ "VMware Unveils VMware Tools as Open Source Software". LXer. http://lxer.com/module/newswire/view/92570/index.html. Retrieved 2009-07-01. 

[edit] External links


 
CSC204, DOS Basic Command
 
What is DOS
What is DOS?
 
 
 
 
 
Untitled Document
Unlimited calls
Click here

Law firm System
Klik sini
http://www.lawmais.com/secure/images/lawmais.png
Dakwah tanggugjawab kita
Nabi menangis mengenangkan umatnya. Kasihanilah mereka yang masih tidak dapat mengenal Allah. Bantulah mereka....



Tadarus Hafazan
Tadarus Hafazan Sudah bermula. Sila hubungi admin jika ingin menyertai. Yuran adalah percuma. Klik sini untuk maklumat lanjut


 
 
Untitled Document
Copyright © 2010 roslanjam@yahoo.com. All Rights Reserved.
Guest online: 2